Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can anyone find a solution for this???

I need a function to stretch a HBITMAP or CBitmap object to a specific size; i.e., I will pass HBITMAP or CBitmap object, width and height to a function and then when I use that HBITMAP or CBitmap object after the function, I need to get the stretched bitmap handle.
Posted

1 solution

One way to do this would be to do the following...

1. Create a new bitmap of the size you want.
2. Select it into a memory DC.
3. StretchBlt() the original bitmap to this DC.
4. Unselect the new bitmap from the DC.

Here's an article that explains some of the details.
 
Share this answer
 
Comments
Vineeth.B 29-Feb-12 23:29pm    
Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900