PRWIN9101003: PaintRgn with Hatch Brush Always Fills Opaque

ID Number: Q68340

3.00

WINDOWS

buglist3.00 fixlist3.10

Summary:

PROBLEM ID: WIN9101003

SYMPTOMS

Under version 3.0 of the Microsoft Windows graphical environment,

when an application selects a hatched brush into a device context

(DC) and the background mode is set to TRANSPARENT, the PaintRgn

function fills the region as though the mode were set to OPAQUE.

RESOLUTION

Microsoft has confirmed this to be a problem in Windows version

3.0. To work around this problem, perform the following three

steps:

1. Select the region to be painted into the DC. This makes the

region the clipping region.

2. Retrieve the smallest bounding rectangle of the region with the

GetRgnBox function.

3. Use the coordinates returned from GetRgnBox to call the

Rectangle function. The output of the Rectangle function is

clipped by the DC and Rectangle does a TRANSPARENT fill.

Only the portions of the region that correspond to the rectangle

are outlined. To outline the region, select a NULL brush as the

background brush and draw the object once more.

Unless another region is selected by the application, the region

selected as the clipping region remains in effect throughout the

life of the DC.

This problem was corrected in Windows version 3.1.

Additional reference words: 3.00 MICS3 R2.7