Pelles C forum

C language => Graphics programming => Topic started by: leandrojardim on June 14, 2016, 01:47:31 am

Title: How to map a point to a "stretched" bitmap
Post by: leandrojardim on June 14, 2016, 01:47:31 am
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.
Title: Re: How to map a point to a "stretched" bitmap
Post by: leandrojardim on June 14, 2016, 06:03:33 am
I found that I need to scale the coordinates. Finally it's working. :)