1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
Public Class Form2
Private ChibiBmp As New Bitmap(300, 300)
Private Sub Form2_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
PicFinal.Size = New Size(300, 300)
PicFinal.SizeMode = PictureBoxSizeMode.StretchImage
Panel1.AutoScroll = True
End Sub
Private Sub CheckBox1_Click(sender As System.Object, e As System.EventArgs) Handles CheckBox5.Click, CheckBox4.Click, CheckBox3.Click, CheckBox2.Click, CheckBox1.Click
If Panel1.Controls.Count < 0 Then Return
Using gr As Graphics = Graphics.FromImage(ChibiBmp)
gr.Clear(Color.White)
For i As Integer = 0 To Panel1.Controls.Count - 1
Dim chk As CheckBox = Panel1.Controls(i)
If chk.Checked Then
Dim bmp As Bitmap = New Bitmap(chk.BackgroundImage, 300, 300)
gr.DrawImage(bmp, Point.Empty)
End If
Next
End Using
PicFinal.Image = ChibiBmp
End Sub
End Class |
Partager