Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic FlowChart saveTo doesn't save assigned images (Read 4712 times)
tronied
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 17
Joined: May 7th, 2008
FlowChart saveTo doesn't save assigned images
Dec 22nd, 2008 at 12:38pm
Print Post  
When I use a Box.setImage() method, the image is loaded and displayed in the box fine. However, when I save and exit (using FlowChart.saveTo), and load it back again the image has disappeared and left a blank box. Any ideas why this is happening? Is there something I have to do to save the image link? As I said in the other thread, I am using version 1.

Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: FlowChart saveTo doesn't save assigned images
Reply #1 - Dec 22nd, 2008 at 1:32pm
Print Post  
In version 1 you can enable saving images through the  FlowChart.getSerializationOptions() object. It should have a setEnableImages(bool) or setImages(bool) method that does that.
  
Back to top
 
IP Logged
 
tronied
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 17
Joined: May 7th, 2008
Re: FlowChart saveTo doesn't save assigned images
Reply #2 - Dec 22nd, 2008 at 1:52pm
Print Post  
Thanks for the quick reply. The only set methods I could find in getSerializationOptions() are get/set methods of:

backgroundImage
behavior
appearance
grid
defaultItemAttributes

Of which I have tried setting them all to true, but the problem remains.

There is a function in the FlowChart.PrintOptions called setEnableImages(bool), but it doesn't seem to have any affect when I am saving and loading the flowchart and only seem to refer to printing.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: FlowChart saveTo doesn't save assigned images
Reply #3 - Dec 22nd, 2008 at 2:23pm
Print Post  
In fact, box images should be saved unconditionally if you are using binary format. Please email the saved flowchart to support@mindfusion.eu and our developer will check what happens.

Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: FlowChart saveTo doesn't save assigned images
Reply #4 - Dec 22nd, 2008 at 4:53pm
Print Post  
The toolkit.getImage() method you are using to load images loads them in a very old format (from the Java 1.x days), and it might not be compatible with ImageIO.write() which JDiagram uses to save image data. Could you check how it works if you use the ImageIO.read() method?
  
Back to top
 
IP Logged
 
tronied
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 17
Joined: May 7th, 2008
Re: FlowChart saveTo doesn't save assigned images
Reply #5 - Dec 22nd, 2008 at 5:20pm
Print Post  
Took your advice and did the following:

Image image = ImageIO.read(new BufferedInputStream(new FileInputStream(sFullPath)));

instead of:

Image image = toolkit.getImage(sFullPath);

and its working now Smiley

Thanks, and have a nice Christmas.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: FlowChart saveTo doesn't save assigned images
Reply #6 - Dec 23rd, 2008 at 6:02am
Print Post  
Have A Merry Christmas too!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint