TeeChart Panel Image

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Mr.Hu_NotProSupport
Newbie
Newbie
Posts: 9
Joined: Fri Jan 29, 2010 12:00 am

TeeChart Panel Image

Post by Mr.Hu_NotProSupport » Sat Oct 08, 2016 9:22 am

When I use the code to specify the background of the TeeChart figure, why are specified after the black, where the settings are wrong? In addition to the background image with what method to adjust the transparency?

Dim St As String
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form3))
OpenFileDialog1.InitialDirectory = "c:\"
OpenFileDialog1.Title = ("选择一个图片")
OpenFileDialog1.Filter = "所有合法图片|(*.bmp;*.jpg;*.gif;*.png)|位图档 (*.bmp)|*.bmp|JEPG文件 (*.jpg)|*.jpg|GIF文件 (*.gif)|*.gif|PNG文件 (*.png)|*.png|所有文件 (*.*)|*.*"
OpenFileDialog1.FilterIndex = 1
OpenFileDialog1.RestoreDirectory = True
If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
St = OpenFileDialog1.FileName
If IsNothing(St) = False Then
Me.TChart1.Panel.Brush.Gradient.Visible = False
Me.TChart1.Panel.Brush.Image = CType(resources.GetObject(St), System.Drawing.Image)
Me.TChart1.Panel.Brush.ImageMode = Steema.TeeChart.Drawing.ImageMode.Center
Me.TChart1.Panel.Brush.ImageTransparent = True
Me.TChart1.Panel.Image = CType(resources.GetObject(St), System.Drawing.Image)
Me.TChart1.Panel.ImageMode = Steema.TeeChart.Drawing.ImageMode.Center
Me.TChart1.Panel.ImageTransparent = True
End If

End If

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: TeeChart Panel Image

Post by Christopher » Mon Oct 10, 2016 9:41 am

Hello,

This works for me here:

Code: Select all

  Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    InitializeChart()
  End Sub

  Sub InitializeChart()
    Dim St As String
    Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1))
    OpenFileDialog1.InitialDirectory = "c:\"
    OpenFileDialog1.Title = ("选择一个图片")
    OpenFileDialog1.Filter = "所有合法图片|(*.bmp;*.jpg;*.gif;*.png)|位图档 (*.bmp)|*.bmp|JEPG文件 (*.jpg)|*.jpg|GIF文件 (*.gif)|*.gif|PNG文件 (*.png)|*.png|所有文件 (*.*)|*.*"
    OpenFileDialog1.FilterIndex = 1
    OpenFileDialog1.RestoreDirectory = True
    If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
      St = OpenFileDialog1.FileName
      If IsNothing(St) = False Then
        Me.TChart1.Panel.Gradient.Visible = False
        Me.TChart1.Panel.Image = ImageList1.Images(Path.GetFileName(St))
        Me.TChart1.Panel.ImageMode = Steema.TeeChart.Drawing.ImageMode.Stretch
        Me.TChart1.Panel.ImageTransparent = True
      End If
    End If
  End Sub
Best Regards,
Christopher Ireland / 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

Post Reply