I solved it. It was a simple variable mistake I have made... Sorry
Main Topics
Browse All TopicsHi
I have this code to resize any image in HBITMAP to 320 * 240.
Look:
HDC hDC = hScrDC;
HDC hMemDC1 = CreateCompatibleDC(hDC);
HBITMAP hBitmap1 = CreateCompatibleBitmap(hDC
HGDIOBJ hOld1 = SelectObject(hMemDC1, hBitmap1);
HDC hMemDC2 = CreateCompatibleDC(hDC);
HGDIOBJ hOld2 = SelectObject(hMemDC2, hBitmap);
BITMAP bitmap = { 0 };
GetObject(hBitmap, sizeof(BITMAP), &bitmap);
StretchBlt(hMemDC1, 0, 0, 320, 240, hMemDC2, 0, 0, nWidth, nHeight, SRCCOPY);
SelectObject(hMemDC1, hOld1);
SelectObject(hMemDC2, hOld2);
DeleteDC(hMemDC1);
DeleteDC(hMemDC2);
It works if nWidth and nHeight (src image width and size is 320 * 240). But it means no change. But when I make it larger or smaller I can't get 320 * 240 image.
Any ideas?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: jkrPosted on 2009-11-08 at 09:51:42ID: 25771184
Should work with any size (not to speak of the quality of the result, but...) - what error do you get?