Jump to content
Software FX Community

exporting chart fx to jpeg format


noobie
 Share

Recommended Posts

hi there! I have no problem about how to export the chart to an image, but my problem is, after exported, the size of an image is so big like 203 kb, I want to reduce the size of an image. I change the width and height of the chart but still the size of the image is big.

 

here is my code after passing the values to the chart:

this code is to export the chart. 

Dim saveImage As String = "C:\images\" & < filename > & ".jpg"Chart1.Export(SoftwareFX.ChartFX.FileFormat.Bitmap, saveImage)

 

I just want the image reduce the size like at least 20 kb because i did that in asp.net, but when I changed to windows form the size is about 203 kb.

How can I do this... anyone can help? I will appreciate it.. Thanks a Lot ! 

Link to comment
Share on other sites

If what you need is to end up with a chart image saved as Jpeg, then you will need to export the chart to a memory stream, create a Bitmap object from the stream, and then save the image to Jpeg. You can do as follows:

Dim ms As New MemoryStream

Chart1.Export(FileFormat.Bitmap, ms)

ms.Position = 0

Dim img As Bitmap

img = New Bitmap(Image.FromStream(ms))

img.Save("C:\\Temp\\ChartSizeTest.jpg", ImageFormat.Jpeg)

Link to comment
Share on other sites

  • 2 weeks 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.

 Share

×
×
  • Create New...