You can't get a DC *from* a bitmap. A DC references some sort of drawing
surface. You'd have to create one with CreateDC, CreateCompatibleDC or a
similar API call. If you do create one, you can then SelectObject a bitmap
into that and any drawing that is done to that DC will be done onto the
bitmap. Look up CreateCompatibleDC(), CreateCompatibleBitmap(), CreateDC(),
SelectObject() in the SDK help for whatever device type you are using.
Paul T.
[quoted text, click to view] "climax!" <artlig@wp.pl> wrote in message
news:1130779817.438277.211440@o13g2000cwo.googlegroups.com...
> Hi!
>
> I am writing a custom scrollbar which will be partly transparent.
> Everthing runs ok, I imported some functions from the gdi(like
> transparentimage() etc)... but i can't find a way to get a DC from a
> Bitmap object(loaded from resources) which is necessary for the gdi
> methods. Now, I thought about displaying the bitmap in a hidden
> control(child window), take its hwnd and then get it's DC... this
> should work but seems not to be a very elegant solution. Does anybody
> has an other idea?
>
> thanx.
>