Episodio1
21st April 2009, 15:22
Hi!
Im new with VC++ and I'm developing with .NET compact (PDA/mobiles) and I'd like to know how can I add a zoom option when I load an image.
This is my current code to show image:
CBitmap *bk,*old;
HBITMAP a;
DWORD d;
a=::SHLoadImageFile(_T("c:\\a.png")); // LoadImage() doesnt work in WinCE.
bk=CBitmap::FromHandle (a);
CRect rec;
CDC Mem;
Mem.CreateCompatibleDC(&dc);
old=Mem.SelectObject(bk);
BITMAP bmpInfo;
bk->GetBitmap(&bmpInfo);
this->GetClientRect(rec);
dc.StretchBlt(0,0,rec.right,rec.bottom,&Mem,0,0,bmpInfo.bmWidth,bmpInfo.bmHeight ,SRCCOPY);
Mem.SelectObject(old);
Im new with VC++ and I'm developing with .NET compact (PDA/mobiles) and I'd like to know how can I add a zoom option when I load an image.
This is my current code to show image:
CBitmap *bk,*old;
HBITMAP a;
DWORD d;
a=::SHLoadImageFile(_T("c:\\a.png")); // LoadImage() doesnt work in WinCE.
bk=CBitmap::FromHandle (a);
CRect rec;
CDC Mem;
Mem.CreateCompatibleDC(&dc);
old=Mem.SelectObject(bk);
BITMAP bmpInfo;
bk->GetBitmap(&bmpInfo);
this->GetClientRect(rec);
dc.StretchBlt(0,0,rec.right,rec.bottom,&Mem,0,0,bmpInfo.bmWidth,bmpInfo.bmHeight ,SRCCOPY);
Mem.SelectObject(old);