C language > Graphics programming

How to map a point to a "stretched" bitmap

(1/1)

leandrojardim:
I am blitting an offscreen bitmap to a overlapped window where I draw bitmap "objects" and my program allows the user to select and move the objects around the screen with the mouse. The problem is that I want to allow the user to resize the window and the offscreen bitmap together with it. When I resize the window and I click an object with the mouse the mouse cursor coordinates points to the object on the non-scaled bitmap, but I need to find the object on the scaled bitmap. How can I fix this, please? This is for a personal project.

leandrojardim:
I found that I need to scale the coordinates. Finally it's working. :)

Navigation

[0] Message Index

Go to full version