Page 1 of 1

TeeChart Panel Image

Posted: Sat Oct 08, 2016 9:22 am
by 16055158
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

Re: TeeChart Panel Image

Posted: Mon Oct 10, 2016 9:41 am
by Christopher
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