Hi
I'm trying to export my graph to file by using this code in VB net 2005:
Dim MyBmpFile As Steema.TeeChart.Export.BitmapFormat = Tchart1.Export.Image.Bitmap
MyBmpFile.Save(strSavePath)
The strange thing is that tchart1 has a size of 800*320 and the myBmpFile variable ends up having a size of 1467*840 and so does the final image
Is there any other way to control the size of the final output so I get a bmp that is 800*320?
thanks in advance
Lars Iversen
problems with size of exported bitmap image
-
- Newbie
- Posts: 61
- Joined: Wed Jun 22, 2005 4:00 am
- Location: cph
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Lars,
Yes, you have several options. They are very similar:
1.
2.
3.
Hope this helps!
Yes, you have several options. They are very similar:
1.
Code: Select all
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
InitializeChart()
End Sub
Private Sub InitializeChart()
Me.TChart1.Width = 800
Me.TChart1.Height = 320
Dim strSavePath As String = "C:\\temp\\vbnet.bmp"
Dim MyBmpFile As Steema.TeeChart.Export.BitmapFormat = TChart1.Export.Image.Bitmap
MyBmpFile.Width = Me.TChart1.Width
MyBmpFile.Height = Me.TChart1.Height
MyBmpFile.Save(strSavePath)
End Sub
Code: Select all
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
InitializeChart()
End Sub
Private Sub InitializeChart()
Me.TChart1.Width = 800
Me.TChart1.Height = 320
Dim strSavePath As String = "C:\\temp\\vbnet.bmp"
TChart1.Export.Image.Bitmap.Width = Me.TChart1.Width
TChart1.Export.Image.Bitmap.Height = Me.TChart1.Height
TChart1.Export.Image.Bitmap.Save(strSavePath)
End Sub
Code: Select all
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
InitializeChart()
End Sub
Private Sub InitializeChart()
Me.TChart1.Width = 800
Me.TChart1.Height = 320
Dim strSavePath As String = "C:\\temp\\vbnet.bmp"
Dim bmp As Bitmap = TChart1.Bitmap()
bmp.Save(strSavePath)
End Sub
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |