Jump to content
Software FX Community

Map crashes for a very large width and height


atesfay1

Recommended Posts

Hi,

 

A Map created with the following specification for the US-States SVG crashes.

 ...

map1

.Chart.AllSeries.PointLabels.Font = new Font("Arial", 8, FontStyle.Regular);

map1.Chart.Width = 6000;

map1.Chart.Height = 6000;

map1.Chart.Export( FileFormat.png, sPath);

 

Note: For an SVG file that has longer geography titles, the width and height specification don't have to be this large for it to break.

The stack trace of the error is as follows:

 

"System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ArgumentException: Parameter is not valid.\r\n at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)\r\n at System.Drawing.Bitmap..ctor(Int32 width, Int32 height)\r\n at ChartFX.WebForms.Internal.v.a(Graphics A_0, Int32 A_1, Int32 A_2)\r\n at ChartFX.WebForms.Chart.n()\r\n at ChartFX.WebForms.Chart.cp()\r\n at ChartFX.WebForms.Annotation.AnnotationText.SizeToFit()\r\n at ChartFX.WebForms.Annotation.AnnotationText.set_Font(Font value)\r\n at ChartFX.WebForms.Maps.MapGallery.a(MapElement A_0, AnnotationText A_1, AttributesBase A_2, Int32 A_3, Boolean A_4, Boolean A_5)\r\n at ChartFX.WebForms.Maps.MapGallery.b(MapElement A_0, AttributesBase A_1)\r\n at ChartFX.WebForms.Maps.MapGallery.d(MapElement A_0)\r\n at ChartFX.WebForms.Maps.MapElementCollection.b()\r\n at ChartFX.WebForms.Maps.MapGallery.e(Int32 A_0)\r\n at ChartFX.WebForms.Maps.MapGallery.f(Boolean A_0)\r\n at ChartFX.WebForms.Maps.MapGallery.a(Int32 A_0, PaintMarkBase A_1, Int32& A_2, Int32& A_3)\r\n at ChartFX.WebForms.u.r()\r\n at ChartFX.WebForms.u.a(IFrame A_0, Int32& A_1)\r\n at ChartFX.WebForms.Chart.a(PaintBar A_0, IGraphicsEx A_1)\r\n at ChartFX.WebForms.Chart.a(PaintBar A_0, IGraphicsEx A_1, Rectangle& A_2)\r\n at ChartFX.WebForms.Chart.a(IGraphicsEx A_0, Rectangle A_1, Boolean A_2)\r\n at ChartFX.WebForms.Chart.a(Stream A_0, IOutputWriter A_1, OutputText A_2, OutputText A_3, OutputInfo A_4)\r\n at ChartFX.WebForms.Chart.a(String A_0, Stream A_1, TextWriter A_2, TextWriter A_3)\r\n at ChartFX.WebForms.Chart.Export(FileFormat format, Stream stream)\r\n at ChartFX.WebForms.Chart.Export(FileFormat format, String fileName)\r\n ... --- End of inner exception stack trace ---"

 

Thanks for your help

Link to comment
Share on other sites

Hi,

Thanks for the quick response.

 You can actually recreate this problem by using one of the sample applications provided by ChartFx ( [installation Path]\Chart FX 7\Help and Samples\Sample Applications\Web Forms\VS2005\WorldPopulation ). Set the width and height of Chart1 to 8000 and try to

Chart1.Export(

FileFormat.Png, @"C:\temp\worldpopulation.png");

You should get the following stack trace error:

at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format) at System.Drawing.Bitmap..ctor(Int32 width, Int32 height) at ChartFX.WebForms.Internal.v.a(Graphics A_0, Int32 A_1, Int32 A_2) at ChartFX.WebForms.Chart.n() at ChartFX.WebForms.Chart.cp() at ChartFX.WebForms.Annotation.AnnotationList.a(IGraphicsEx A_0, Rectangle A_1, Boolean A_2, Boolean A_3, Int32 A_4, Int32 A_5) at ChartFX.WebForms.Annotation.Annotations.a(IGraphicsEx A_0, Rectangle A_1, Boolean A_2, Int32 A_3, Int32 A_4) at ChartFX.WebForms.Maps.MapGallery.a(PaintMarkBase A_0, Rectangle A_1, Int32 A_2, Int32 A_3) at ChartFX.WebForms.Maps.MapGallery.a(Int32 A_0, PaintMarkBase A_1, Int32& A_2, Int32& A_3) at ChartFX.WebForms.u.a(Int32& A_0, Int32& A_1) at ChartFX.WebForms.u.r() at ChartFX.WebForms.u.a(IFrame A_0, Int32& A_1) at ChartFX.WebForms.Chart.a(PaintBar A_0, IGraphicsEx A_1) at ChartFX.WebForms.Chart.a(PaintBar A_0, IGraphicsEx A_1, Rectangle& A_2) at ChartFX.WebForms.Chart.a(IGraphicsEx A_0, Rectangle A_1, Boolean A_2) at ChartFX.WebForms.Chart.a(Stream A_0, IOutputWriter A_1, OutputText A_2, OutputText A_3, OutputInfo A_4) at ChartFX.WebForms.Chart.a(String A_0, Stream A_1, TextWriter A_2, TextWriter A_3) at ChartFX.WebForms.Chart.Export(FileFormat format, Stream stream) at ChartFX.WebForms.Chart.Export(FileFormat format, String fileName)

 

The width and height value thresholds that cause this error varies from svg to svg.

Thanks

Link to comment
Share on other sites

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...