Jump to content
Software FX Community

Problem with different Operation Systems


jrgu69
 Share

Recommended Posts

I have
installed a ChartFX license an operating system Windows XP, which generated a
graph using vb.net and show this in a PDF. In this case the graphs are
displayed correctly, correct size.



But to
generate this same chart on a Windows 7 32-bit, the graphics s is larger,
outside the range of measures indicated. This also for
operating systems Windows Server 2003, Windows Server 2008 R2.



pdf_wrong.png image show the correct size of chart (green line) and the wrong size (red line).

The error
also occurs when printing, not only when generating a PDF.



I appreciate your help.



Greetings

Link to comment
Share on other sites

To change the DPI of the chart you would need to create a Graphics object from a high resolution Bitmap and then use the Paint method to paint the chart to the Graphics. Here is the code you are looking for (for 300 DPI, for example).

Rectangle r = new Rectangle (0, 0, (chart1.Width * 300) / 96, (chart1.Height * 300) / 96); Bitmap bmp = new Bitmap (r.Width, r.Height); bmp.SetResolution(300, 300); Graphics g = Graphics .FromImage(bmp); chart1.Paint(g, r, PaintStyles .Background | PaintStyles .Border | PaintStyles .Print); bmp.Save( @"c:\temp\cfxdpi.bmp" ); g.Dispose(); bmp.Dispose();

You can save the file in different formats:

bmp.Save( @"c:\temp\cfx.jpg" , ImageFormat .Jpeg); bmp.Save( @"c:\temp\cfx.gif" , ImageFormat .Gif); bmp.Save( @"c:\temp\cfx.tif" , ImageFormat .Tiff);

 Then try printing the image file.

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...