News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Deleting a Region

Started by georgek01, April 19, 2011, 09:32:26 AM

Previous topic - Next topic

georgek01

Hi there,

I'm adding a few Regions (CreateEllipticRgn) in response to WM_PAINT messages. To do hit testing on the Regions later, I do not delete the Region handles (I store them in an array).

- when my form is resized quickly or if a fair amount of Regions are added, all painted Regions are removed from the form and no more painting takes place.
- if I however delete the Region handles after each paint operation, the problem does not occur, but then I can't do hit testing on the Regions.

My question is, how do I free up the Region resources but still do hit testing on them?

I've added a small app (adapted from Iczelion's PAINT tutorial) to demonstrate the hit test conundrum.


Regards,
George
What we have to learn to do, we learn by doing.

- ARISTOTLE (384-322 BC)

georgek01

I may have found a solution...

I'm deleting all the Region handles from the array before re-painting. That seems to free up the resources and I'm able to do hit testing on the newly created Regions in the array.

What we have to learn to do, we learn by doing.

- ARISTOTLE (384-322 BC)