How to draw a resizable rectangle

Post Reply
User avatar
Rafael Clemente
Posts: 365
Joined: Sat Oct 08, 2005 7:59 pm
Location: Barcelona, Spain

How to draw a resizable rectangle

Post by Rafael Clemente »

Anybody could give me an idea about how to draw a resizable rectangle on a Dialog?. I mean, the kind of rectangle used to select a region of a Bitmap, that expands and contacts as you move the mouse. I have tried several aproaches with Rectange(), RectDot() and LineTo() but I am sure it must be a simpler way.
Thanks
Rafael
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Rafael,

You might look at the incomplete IDE samples that come with FW. I can't remember if there was such an thing for dialog design, but it is worth a look.

James
User avatar
Rafael Clemente
Posts: 365
Joined: Sat Oct 08, 2005 7:59 pm
Location: Barcelona, Spain

Post by Rafael Clemente »

James:
Thank you. I had erased long ago my FW folder. I have re-installed it and found the program you suggested. I'm going to take a long look at it.
Thks
Rafael
User avatar
Rafael Clemente
Posts: 365
Joined: Sat Oct 08, 2005 7:59 pm
Location: Barcelona, Spain

Post by Rafael Clemente »

James:

Thank you for your suggestion. Problem solved. The trick -in case it can be of use to anybody esle- is to use bMMoved() and bLClicked() together with DrawFocusRect() and call this last function twice: The first to erase the previous rectangle, the second to draw it in a sligtly different place.

Best regards,
Rafael
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Glad to hear you got it working.
Post Reply