Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Transparent pictures in boxes (Read 2893 times)
unisnk
Junior Member
**
Offline


D'Oh!

Posts: 59
Joined: Sep 3rd, 2008
Transparent pictures in boxes
Dec 10th, 2008 at 4:27pm
Print Post  
Hello,

Another little problem: when I load an image with "transparent" pixels into a box (i.e. a GIF image), I expect that where image is transparent, I have to see the box color while i obtain "black" pixels...

Example:

I have this box:


I want to load this image in it (as you can see it's a transparent GIF)


I repaint the whole chart setting the property
Code
Select All
fcx.BoxPicture := myTPicture; 

(in myTPicture there is the loaded image)

And I obtain this result:


I expect the box is still coloured in green (with the image within), but it's strangely in black.

What can I do to have the right result?

Thanks in advance!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Transparent pictures in boxes
Reply #1 - Dec 10th, 2008 at 5:43pm
Print Post  
Note the remark for Box.Picture topic in the help file - the image transparency data might be lost before it gets to the box. That's for VB, but if Delphi uses the same OLE StdPicture type, the same problem might happen. Does the image show correctly if you use the box.LoadPicture() method instead?
« Last Edit: Dec 10th, 2008 at 7:22pm by Stoyo »  
Back to top
 
IP Logged
 
unisnk
Junior Member
**
Offline


D'Oh!

Posts: 59
Joined: Sep 3rd, 2008
Re: Transparent pictures in boxes
Reply #2 - Dec 11th, 2008 at 9:50am
Print Post  
ok, it works with loadpicture ()



Since I have to load an image for each box drawn on the chart, I wanted to avoid to load everytime an image from a file.

Are you sure there are not other ways to load an image in memory and then assign it to a box with the box.picture property? (of course without losing transparency...)
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Transparent pictures in boxes
Reply #3 - Dec 11th, 2008 at 11:59am
Print Post  
Try creating temporary box, call LoadPicture on it, assign the temp_box.Picture to all other boxes, delete the temp box.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint