2017年12月11日 星期一

[ VB2010 ] - 繪製圖片

[ VB2010 ] - 繪製圖片

Graphics.DrawImage(圖片物件, X, Y)
Graphics.DrawImage(圖片物件, X, Y, W, H)




Public Class Form1
    Dim Painting As Bitmap = New Bitmap(400, 400)

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim G As Graphics = Graphics.FromImage(Painting)
        Dim BMP As Bitmap

        BMP = Image.FromFile("C:\Users\User\Documents\Visual Studio 2010\Projects\WindowsApplication16\WindowsApplication16\1.jpg")

        G.DrawImage(BMP, 50, 50)

        Me.BackgroundImageLayout = ImageLayout.None
        Me.BackgroundImage = Painting
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        End
    End Sub
End Class



沒有留言:

張貼留言

WOKWI LED + MQTT Node-Red SQLite

WOKWI LED + MQTT Node-Red SQLite const char *mqtt_broker = "broker.mqtt-dashboard.com" ; const char *topic1 = "alex9ufo/e...