2020年5月15日 星期五

vb.net Chart轉換成圖片到PictureBox [Chart to PictureBox]


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


        Dim bmp As New Bitmap(Chart1.Width, Chart1.Height)

        Dim rec As New Rectangle(0, 0, Chart1.Width, Chart1.Height)

        'Dim bmp As New System.Drawing.Bitmap(Chart1.Width, Chart1.Height)

        'Dim rec As New System.Drawing.Rectangle(0, 0, Chart1.Width, Chart1.Height)

        Chart1.DrawToBitmap(bmp, rec)

        PictureBox1.Image = bmp

        'bmp = New Bitmap(bmp, New Size(64, 64)) 'Resize


    End Sub

沒有留言:

張貼留言