Jump to content
Software FX Community

exporting chart fx to jpeg format


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...


This topic is now archived and is closed to further replies.

  • Create New...