Nicolas Nicolas - 4 months ago 11
Vb.net Question

Saved image of chart is fuzzy/noisy

I have two MS Charts that I wish to export as .png images. For both I use the

Chart.SaveImage()
method, but with different results. One is fuzzy/noisy and the other looks clean.

Here is the fuzzy graphic (later called ChartBHKW). Please note that only the text outside the Chart looks blurry. The legend is displayed correctly.

Fuzzy graphic

And here is the normal graphic, saved as it should be (later called ChartAmortisation):

Normal graphic

In order to preserve the image size and aspect ratio, the two Charts undergo the following saving procedure: undock, rezise, save, and dock again. Code below.

With Main.ChartBHKW
'Resize and save
.Dock = DockStyle.None
.Size = PrintSize
.SaveImage(JDLImagePath, ChartImageFormat.Png)

'Reset
.Dock = DockStyle.Fill
End With

With Main.ChartAmortisation
'Resize and save
.Dock = DockStyle.None
.Size = PrintSize
.SaveImage(AmortisationImagePath, ChartImageFormat.Png)

'Reset
.Dock = DockStyle.Fill
End With


I tried with various different sizes and formats. The size has no influence. But it is interesting to see what happens when saved as .jpg or .bmp. Example below.

Fuzzy graphic as jpg

Any idea?

Han Han
Answer

I strongly believe that it is related to the background, I guess it's transparent. Use white instead

Comments