Page 1 of 1

About self drawing

Posted: Sat May 14, 2016 4:32 pm
by callroot
StartDrawing Output HDC

If I were to drawing TreeGadget

Node row hover color 》》》》》》》》 A transparent background image


How to modify HDC With StartDrawing


I am very confused

Please give a simple example, using StartDrawing to draw the specified HDC

Re: About self drawing

Posted: Tue May 17, 2016 11:13 pm
by Hadrianus
As far as I know a background image inside a treegadget is not possible. Then you have to use windows api for get it done, but I have no experience with this.

Re: About self drawing

Posted: Wed May 18, 2016 6:15 am
by callroot
Hadrianus wrote:As far as I know a background image inside a treegadget is not possible. Then you have to use windows api for get it done, but I have no experience with this.


thank you

Re: About self drawing

Posted: Mon May 30, 2016 10:10 am
by Shardik
oryaaaaa posted this code example to display a TreeGadget with an image as background in 2004 (and updated his example more recently for PB 5.20+).

You have to add your own picture by replacing

Code: Select all

  LoadImage(0, "c:\body.bmp")
by (for example)

Code: Select all

  LoadImage(0, #PB_Compiler_Home + "Examples\3D\Data\Textures\Clouds.jpg")
and adding

Code: Select all

UseJPEGImageDecoder()
to the top of the code in order to try it (tested successfully on Windows XP SP3 and Windows 7 x86 SP1).