Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Export to Images (jpg) (Read 4159 times)
tusharpateluk
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 37
Joined: Sep 3rd, 2008
Export to Images (jpg)
Sep 3rd, 2008 at 4:48pm
Print Post  
How can I export a diagram to .jpg file.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export to Images (jpg)
Reply #1 - Sep 3rd, 2008 at 4:55pm
Print Post  
Call Diagram.CreateImage() to get a BitmapSource object representing the diagram. Create JpegBitmapEncoder instance and use its Save method to save the bitmap as a jpeg file.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
tusharpateluk
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 37
Joined: Sep 3rd, 2008
Re: Export to Images (jpg)
Reply #2 - Sep 3rd, 2008 at 5:30pm
Print Post  
Thanks for the quick answer. It works
  
Back to top
 
IP Logged
 
tusharpateluk
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 37
Joined: Sep 3rd, 2008
Re: Export to Images (jpg)
Reply #3 - Oct 7th, 2008 at 10:05am
Print Post  
I have saved the diagram into .JPG but it shows black background outside the diagram area. Can you tell me how to get ride of it.

As I am programatically adding these images to a PDF file.

Please suggest
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export to Images (jpg)
Reply #4 - Oct 7th, 2008 at 12:39pm
Print Post  
Can you see the black background if you open the jpeg file? The image returned by CreateImage() should be exactly as big as the diagram. So the background might have been added by the PDF tool you are using, or by the BitmapEncoder.
  
Back to top
 
IP Logged
 
tusharpateluk
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 37
Joined: Sep 3rd, 2008
Re: Export to Images (jpg)
Reply #5 - Oct 7th, 2008 at 3:23pm
Print Post  
I have used Mindfusion.Utilities.SaveImage() method to save file in Jpg format. When I open the jpg file it still shows me black background for the area Outside the diagram.
  
Back to top
 
IP Logged
 
tusharpateluk
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 37
Joined: Sep 3rd, 2008
Re: Export to Images (jpg)
Reply #6 - Oct 7th, 2008 at 3:45pm
Print Post  
I found the solution. I had set diagram zoom factor to 90 and hence I was getting black background. I have set it back to 100 and it works fine. Thanks for your help.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint