当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

    摘要: 代碼如下﹕ procedure tform1.button1click(sender: tobject); var edit:tedit; begin //edit := tedit.create(nil); //1 //edit := tedit.create(self); //2 //edit := tedit.create(application);//3 //edit := ted......
    摘要: 如果我想在一幅图片的的指定位置修改它的像素值,设定自己需要的像素值,然后将改完后的图片保存,请问该怎么做?能给个demo吗?先谢谢了。 ......


vc又出错了,说我定义错误,请高手指点谢谢

#include<afxwin.h>  
  #include<strstrea.h>  
  const   int   IDC_SB1=   100;  
  const   int   IDC_CS1=   101;  
  const   int   IDC_CS2=   102;  
  const   int   IDC_BUTTON=   103;  
  const   int   MIN_RANGE=0;  
  const   int   MAX_RANGE=100;  
  class   CApp:public   CWinApp  
  {  
  public:  
    virtual   BOOL   InitInstance();  
  };  
  CApp   app;  
  class   CWindow:public   CFrameWnd  
  {  
  CScrollBar   *sb1;  
  CStatic   *cs1;  
  CStatic   *cs2;  
  CButton   *button;  
  public:  
  CWindow();  
  afx_msg   void   OnHScroll(UINT   nSBCode,  
  UINT   nPos,CScrollBar   *pScrollBar);  
  afx_msg   void   handleButton();  
  DECLARE_MESSAGE_MAP()  
  };  
  BEGIN_MESSAGE_MAP(CWindow,CFrameWnd)  
  ON_WM_HSCROLL()  
  ON_BN_CLICKED(IDC_BUTTON,handleButton)  
  END_MESSAGE_MAP()  
  CWindow::CWindow()  
  {  
  Create(NULL,"cfa",WS_OVERLAPPEDWINDOW,  
  CRect(0,0,208,208));  
  cs1=new   CStatic();  
  cs1->Create("farhenheit=32",WS_CHILD|WS_VISIBLE|WS_BORDER,  
  CRect(0,0,200,50),  
  this,  
  IDC_CS1);  
  cs2=new   CStatic();  
  cs2->Create("celsius=0",WS_CHILD|WS_VISIBLE|WS_BORDER,  
  CRect(0,51,200,100),  
  this,  
  IDC_CS2);  
  sb1=new   CScrollBar();  
  sb1->Create(WS_CHILD|WS_VISIBLE|SBS_HORZ,  
  CRect(0,101,200,130),  
  this,  
  IDC_SB1);  
  sb1->SetScrollRange(MIN_RANGE,MAX_RANGE,TRUE);  
  sb1->SetScrollPos(32);  
  button=new   CButton();  
  button->Create("quit",WS_CHILD|WS_VISIBLE|WS_BORDER,  
  CRect(0,131,200,180),  
  this,  
  IDC_BUTTON);  
  }  
  void   CWindow::OnHScroll(UINT   nSBCode,UINT   nPos,CScrollBar   *pScrollBar)  
  {  
  int   pos;  
  pos=pScrollBar->GetScrollPos();  
  switch(nSBCode)  
  {  
  case   SB_LINELEFT:  
  pos-=1;  
  break;  
  case   SB_LINERIGHT:  
  pos+=1;  
  break;  
  case   SB_PAGELEFT:  
  pos-=10;  
  break;  
  case   SB_PAGERIGHT:  
  pos+=10;  
  break;  
  case   SB_LEFT:  
  pos=MIN_RANGE;  
  break;  
  case   SB_BOTTOM:  
  pos=MAX_RANGE;  
  break;  
  case   SB_THUMBPOSITION:  
  pos=nPos;  
  break;  
  default:  
  return;  
  }  
  if(pos<MIN_RANGE)  
  pos=MIN_RANGE;  
  else   if(pos>MAX_RANGE)  
  pos=MAX_RANGE;  
  sb1->SetScrollPos(pos,true);  
  char   s[100];  
  ostrstream   ostr(s,100);  
  ostr<<"fahrenheit="<<pos<<ends;  
  SetDlgItemText(IDC_CS1,s);  
  ostr.seekp(ios::beg);  
  ostr<<"celisius="<<(pos-32)*5/9<<ends;  
  SetDlgItemText(IDC_CS2,s);  
  void   CWindowA:handleButton()  
  {  
  DestroyWindow();  
  }  
  BOOL   CApp::InitInstance()  
  {  
  m_pMainWnd=   new   CWindow();  
  m_pMainWnd->ShowWindow(m_nCmdShow);  
  m_pMainWnd->UpdateWindow();  
  return   true;  
  }  
   
   
  --------------------Configuration:   6   -   Win32   Debug--------------------  
  Compiling...  
  6.cpp  
  F:\Debug\6.cpp(102)   :   error   C2601:   handleButton   :   local   function   definitions   are   illegal  
  F:\Debug\6.cpp(106)   :   error   C2601:   InitInstance   :   local   function   definitions   are   illegal  
  F:\Debug\6.cpp(112)   :   fatal   error   C1004:   unexpected   end   of   file   found  
  Error   executing   cl.exe.  
   
  6.exe   -   3   error(s),   0   warning(s)  
 

NO.1   作者: akiko

SetDlgItemText(IDC_CS2,s);  
  }//加上这个  
  void   CWindowA:handleButton()  
 


    摘要: 我从网上找了一篇能够支持esmtp的源码,回来以后看到不支持cc和bcc就自己在 人家的基础上进行了添加,可是问题出现了,邮件的源文件应该没有问题,邮件构造成功,发件人那里多个人也能正常接收.发送的时候没有任何问题. 为了方便大家看清问题,我将构造好的邮件源码,和send()函数列出,请大家都来帮忙呀! 这是构造好的邮件信息: return-path: <angiin@sina.co......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE