Page 1 of 1

Problems with owndraw buttons and background

Posted: Tue Jul 29, 2003 9:33 pm
by GPI
http://caosandkin.bei.t-online.de/pureb ... utton2.zip

I overworked my CostumButtons, but i get a problem. I found a method, how to draw transparent image without using startdrawing(), but i have a little problem:

Image

As you see, the background of the around the buttons is gray and not the same like the background of the mainwindow. (and yes, the buttons are draw real transparent, because outside the round button is the color black!)
It seems, that the redraw of the background in the button is stopped for the mainwindow. How can i change this?

GPI

Posted: Tue Jul 29, 2003 10:13 pm
by Pupil
Try and create a button the API way (CreateWindow_) and see if that works ok. If that works you could make a qualified guess that it's PB that do something to make things difficult for you ;)

Posted: Thu Jul 31, 2003 8:30 pm
by GPI
Found a better methode:

Code: Select all

point.POINT\x=0:point\y=0
MapWindowPoints_(GetParent_(CButton_()\hwnd),CButton_()\hwnd,point,1)
            
BackBrush=GetClassLong_(WindowID(), #GCL_HBRBACKGROUND)
SetBrushOrgEx_(*dis\hDC,point\x,point\y,oldpoint.POINT)
FillRect_(*dis\hDC,*dis\rcItem,BackBrush)
SetBrushOrgEx_(*dis\hDC,oldpoint\x,oldpoint\y,0)
GPI