Code: Select all
Public Shared Function GetImage(ByVal chart As TChart) As Image
Dim strm As New IO.MemoryStream
With chart.Export.Image.Metafile
.Enhanced = True
.Width = chart.Width
.Height = chart.Height
.Save(strm)
strm.Position = 0
End With
Dim img As Image = Image.FromStream(strm)
strm.Flush()
Return img
End Function
Framework version: 1.1.4322.573 TeeChart version: 1.1.1879.21176
Under Windows 98 ONLY we get the following error when export a chart as MetaFile. Exporting the same chart as PNG or JPEG works just fine.
************** Exception Text **************
System.InvalidOperationException: The object is currently in use elsewhere.
at System.Drawing.Graphics.Dispose(Boolean disposing)
at System.Drawing.Graphics.Dispose()
at Steema.TeeChart.Export.MetafileFormat.SaveMetafile(Object FileOrStream)
at Steema.TeeChart.Export.MetafileFormat.Save(Stream stream)
We do not use dotted styles and are able to export to MetaFile using native Framework functions
Not being able to export to MetaFile under Windows 98 is a real showstopper for us.
Because about 60% of our custumers still works with Windows 98.
Would you please investigate this problem and let us now if this can be fixed. If so what's the timeschedule for this? If not are there alternatives to make MetaFile export workable under Windows 98? (ComInterop?)
Regards, Jan