The Windows GDI and Regions
-
Hola friends, I'm working with a Dialog Box that has a rectangle associated with it so that I may draw in it. However, I am interested in adding regions to the rectangle, which I don't seem to have too much trouble doing. However, once I add my regions (three) all of the code within my WM_PAINT message seems to be constricted to drawing within the last region. Does anyone know what happens to the DC when I create a region, and does anybody have any suggestions on how I might be able to change it back to the entire rectangle, like it was originally set? Thanks, Joe
-
Hola friends, I'm working with a Dialog Box that has a rectangle associated with it so that I may draw in it. However, I am interested in adding regions to the rectangle, which I don't seem to have too much trouble doing. However, once I add my regions (three) all of the code within my WM_PAINT message seems to be constricted to drawing within the last region. Does anyone know what happens to the DC when I create a region, and does anybody have any suggestions on how I might be able to change it back to the entire rectangle, like it was originally set? Thanks, Joe
Show some code. I suspect you need to use the
CombineRgn
function withRGN_OR
set infnCombineMode
to make a combined region and then select that into the DC.Steve
-
Hola friends, I'm working with a Dialog Box that has a rectangle associated with it so that I may draw in it. However, I am interested in adding regions to the rectangle, which I don't seem to have too much trouble doing. However, once I add my regions (three) all of the code within my WM_PAINT message seems to be constricted to drawing within the last region. Does anyone know what happens to the DC when I create a region, and does anybody have any suggestions on how I might be able to change it back to the entire rectangle, like it was originally set? Thanks, Joe
I agree with Steve I think you need to CombineRgn
WhiteSky