The brush has its own copy of the bitmap. This is easy to see by removing the bitmap after creating the brush and then using the brush (works great)
Using GetObject to populate the LOGBRUSH structure will return the original BITMAP descriptor to the lbhatch element, but, unfortunately, is not a copy descriptor. And the use of GetObject in the returned bitmap descriptor fails if the bitmap is deleted.
Does anyone know how to get the original sizes of the bitmap images from the brush in this case? I want to create a copy of the template brush, even if the original bitmap is deleted. I can get a copy of the original bitmap just by brushing, but I donβt know its size. I tried using SetbrushorgEx (hdc, -1, -1), hoping that -1 would be reduced in absolute value when the brush is selected in the device context and will get values ββwhen I get GetBrushOrgEx. Does not work.
Keith
source share