T
Tall_Guy_63
Guest
I'm loading a bitmap image into my program window and allowing the user to zoom in and out of it. It all works fine, but if I open the exact same image in MS Paint or any graphics editor, the image is much better looking -- higher quality.
I've experimented with palettes and seen no difference in quality.
I initially load the image into a bitmap:
style=LR_LOADFROMFILE | LR_CREATEDIBSECTION;
hbmpimage=(HBITMAP)LoadImage(NULL,imgname.c_str(),IMAGE_BITMAP,0,0,style);
GetObject(hbmpimage,sizeof(bm),&bm);
imgwidth=bm.bmWidth;
imgheight=bm.bmHeight;
then in the WM_PAINT I write it to the window at the zoomed size the user has it to:
shadowdc=CreateCompatibleDC(hdc);
oldobject=(HBITMAP)SelectObject(shadowdc,(HGDIOBJ)hbmpimage);
StretchBlt(hdc,xpos,ypos,xl,yl,shadowdc,0,0,imgwidth,imgheight,SRCCOPY);
SelectObject(shadowdc,(HGDIOBJ)oldobject);
DeleteDC(shadowdc);
Is there some way I can improve the quality ?
Continue reading...
I've experimented with palettes and seen no difference in quality.
I initially load the image into a bitmap:
style=LR_LOADFROMFILE | LR_CREATEDIBSECTION;
hbmpimage=(HBITMAP)LoadImage(NULL,imgname.c_str(),IMAGE_BITMAP,0,0,style);
GetObject(hbmpimage,sizeof(bm),&bm);
imgwidth=bm.bmWidth;
imgheight=bm.bmHeight;
then in the WM_PAINT I write it to the window at the zoomed size the user has it to:
shadowdc=CreateCompatibleDC(hdc);
oldobject=(HBITMAP)SelectObject(shadowdc,(HGDIOBJ)hbmpimage);
StretchBlt(hdc,xpos,ypos,xl,yl,shadowdc,0,0,imgwidth,imgheight,SRCCOPY);
SelectObject(shadowdc,(HGDIOBJ)oldobject);
DeleteDC(shadowdc);
Is there some way I can improve the quality ?
Continue reading...