About self drawing

Everything else that doesn't fall into one of the other PB categories.
callroot
User
User
Posts: 64
Joined: Sat Mar 05, 2016 10:46 pm

About self drawing

Post 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
Hadrianus
User
User
Posts: 34
Joined: Wed Mar 27, 2013 11:31 pm

Re: About self drawing

Post 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.
callroot
User
User
Posts: 64
Joined: Sat Mar 05, 2016 10:46 pm

Re: About self drawing

Post 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
User avatar
Shardik
Addict
Addict
Posts: 2058
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: About self drawing

Post 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).
Post Reply