Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Limiting size of image drawn with CreateBmpFromChart() (Read 2874 times)
steve
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Feb 23rd, 2010
Limiting size of image drawn with CreateBmpFromChart()
Mar 7th, 2012 at 4:30pm
Print Post  
Hi, I'm doing some support work on an old application that is rendering an organisational structure using FlowChartX.NET version 3.2.1.20797.

In some cases the generated image is pretty huge (over 60 000px wide) when I call CreateBmpFromChart(), which then causes a GDI+ error when I try to save the bitmap to a stream or Image.

I've attached the class that creates the flowchart and renders the image if you would like to check my code - the error occurs on line 418:
> bmp.Save(ms, codec, eps);

Is there a way to prevent this from happening either by setting maximum width/height values for the generated image, or by rendering the image to a number smaller pieces?

Thanks,
Steve
  

OrganisationalStructure.txt (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Limiting size of image drawn with CreateBmpFromChart()
Reply #1 - Mar 8th, 2012 at 7:15am
Print Post  
Hi,

Current versions of the control have a CreateImage(RectangleF)  overload that lets you specify what region of the flowchart should be copied to the image. You could use it to export several smaller images. If there is no such CreateBmpFromChart overload in the version you are using, you could temporarily set DocExtents to a smaller rectangle before calling CreateBmpFromChart to achieve the same effect.

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


I love YaBB 1G - SP1!

Posts: 16
Joined: Feb 23rd, 2010
Re: Limiting size of image drawn with CreateBmpFromChart()
Reply #2 - Mar 8th, 2012 at 11:27am
Print Post  
Hi Stoyo,

Exporting to smaller images works fine.

Thanks for the help!
Steve
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint