我想制作一个具有一定宽度和高度的空白画布位图图像,在VB.NET中,我使用Visual Studio 2017,使用Windows窗体应用程序和.NET Framework 4.6.1。
我尝试使用带有宽度和高度参数的新图像创建一个新的位图图像,但这并没有真正解决。我试着看看和预期的参数,但它并没有真正显示我。
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim Image = New Bitmap(New Image(WidthInput.Value, HeightInput.Value))
End Sub
我希望结果是宽度为WidthInput.Value
和高度为HeightInput.Value
的图像,即纯白色或任何其他颜色。
我做了更多的研究,发现我可以pass the width and height through the Bitmap constructor。宽度和高度需要是Int32
的类型。