Drawing a Bitmap Background
-
I have a skinned dialog that I am attempting to place transparent buttons on; based on CButton. However, when I do a create I find that a blank space is created where my button should be. Therefore the background that shows through my transparent image is white rather than the skinned bitmap that should appear. I imagine that the reason this area is not painted is because that area is to be painted by the button. Is there a way to get that area of the background painted despite the fact that the button is to be painted there? Thanks in advance.
-
I have a skinned dialog that I am attempting to place transparent buttons on; based on CButton. However, when I do a create I find that a blank space is created where my button should be. Therefore the background that shows through my transparent image is white rather than the skinned bitmap that should appear. I imagine that the reason this area is not painted is because that area is to be painted by the button. Is there a way to get that area of the background painted despite the fact that the button is to be painted there? Thanks in advance.
-
(I assume that the buttons you are creating are subclassed
CButton
.) The white spaces is created by someone somewhere. Did you check your handling ofWM_ERASEBKGND
?wm_erase_backgroud should return TRUE; and show your background images in ONpaint method.
-
I have a skinned dialog that I am attempting to place transparent buttons on; based on CButton. However, when I do a create I find that a blank space is created where my button should be. Therefore the background that shows through my transparent image is white rather than the skinned bitmap that should appear. I imagine that the reason this area is not painted is because that area is to be painted by the button. Is there a way to get that area of the background painted despite the fact that the button is to be painted there? Thanks in advance.
-
I have a skinned dialog that I am attempting to place transparent buttons on; based on CButton. However, when I do a create I find that a blank space is created where my button should be. Therefore the background that shows through my transparent image is white rather than the skinned bitmap that should appear. I imagine that the reason this area is not painted is because that area is to be painted by the button. Is there a way to get that area of the background painted despite the fact that the button is to be painted there? Thanks in advance.
I apologize if my attempt to be succinct ended up being unclear. I have looked into what each of you have asked. @Mattias G: Yes, it is a subclassed CButton. I definitely agree that this is being created somewhere, it is just the where I am having difficulty with. I've looked at the OnEraseBkgnd and haven't found anything out of the norm. @shivanandgupta: My OnEraseBkgnd does return true. I do not handle Onpaint method in my dialog. @Niklas Lindquist I do not have WS_CLIPCHILDREN specified in my dialog window. I feel like this is actually rooted in how Create is handled by CButton, one of the window or button styles. I will write back if I find anything.
-
wm_erase_backgroud should return TRUE; and show your background images in ONpaint method.
-
I apologize if my attempt to be succinct ended up being unclear. I have looked into what each of you have asked. @Mattias G: Yes, it is a subclassed CButton. I definitely agree that this is being created somewhere, it is just the where I am having difficulty with. I've looked at the OnEraseBkgnd and haven't found anything out of the norm. @shivanandgupta: My OnEraseBkgnd does return true. I do not handle Onpaint method in my dialog. @Niklas Lindquist I do not have WS_CLIPCHILDREN specified in my dialog window. I feel like this is actually rooted in how Create is handled by CButton, one of the window or button styles. I will write back if I find anything.
Dear what do you want pls tell me details If you want customize button with some bitmap . and your dialog has background Bitmap. firstly you draw dialog bitmap in onpaint dialog. and derived class button should also call own onpaint method with button bitmap.
-
Dear what do you want pls tell me details If you want customize button with some bitmap . and your dialog has background Bitmap. firstly you draw dialog bitmap in onpaint dialog. and derived class button should also call own onpaint method with button bitmap.
I've found and am trying to implement the suggestion found here (CButtonST v3.9) This basically states that I need to force each button to paint it's background after the OnEraseBkgnd is handled by the dialog by calling OnPostEraseBkgnd. Working on getting this solution to function correctly in my code.