CStatic *pPic = (CStatic*)GetDlgItem(IDC_PICTURE);
CBitmap bitmap;
bitmap.LoadBitmapW(IDB_BITMAP2);
pPic->SetBitmap((HBITMAP)bitmap.GetSafeHandle());
//在Picture的Type调为Bitmap
像素修改:
CStatic *pPic = (CStatic*)GetDlgItem(IDC_PICTURE);
CBitmap bitmap;
bitmap.LoadBitmapW(IDB_BITMAP2);
BITMAP mBitmap;
bitmap.GetBitmap(&mBitmap);
HBITMAP hBitmap = (HBITMAP)bitmap.GetSafeHandle();
CImage image;
image.Attach(hBitmap);
int mWidth = image.GetWidth();
int mHeight = image.GetHeight();
_cprintf("width = %d\nheight = %d\n", image.GetWidth(), image.GetHeight());
for (int i = 0; i < mWidth; i++)
{
for (int j = 0; j < mHeight; j++)
{
if (i>=10&&i<=30)
image.Se