noobie Posted January 23, 2008 Report Share Posted January 23, 2008 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 More sharing options...
maximop Posted January 23, 2008 Report Share Posted January 23, 2008 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 More sharing options...
noobie Posted January 31, 2008 Author Report Share Posted January 31, 2008 Wow. this is exactly what I want. thank you very very much maximop !! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.