Dim IS_COL, IS_ROW, IS_TOTAL As Integer
IS_COL = 1
IS_ROW = 10
IS_TOTAL = 10
Dim IS_Height, IS_Width As Integer
IS_Width = 80 'Fix(Me.Panel2.Width / IS_COL) - 10 ' 根据panel 宽平均分配
IS_Height = 80 'Fix((Me.Panel2.Height - 20) / IS_ROW) - 10 ' 根据panel 高平均分配
Me.Panel2.Controls.Clear()
For count1 = 0 To IS_ROW - 1
For count2 = 0 To IS_COL - 1
Dim pbox As New PictureBox
Dim IsNo As String = "0" + CStr(count1 + 1)
pbox.Name = "BC" + IsNo
Dim aa As New C1.Win.BarCode.C1BarCode
aa.CodeType = C1.BarCode.CodeType.QRCode
aa.Text = "1234567890"
aa.AutoSize = False
aa.Size = New Size(80, 80)
pbox.Image = aa.Image
Me.Panel2.Controls.Add(pbox)
pbox.Tag = count1 * IS_COL + count2 + 1
If pbox.Tag > IS_TOTAL Then
Exit For
End If
Dim IsX, IsY As Integer
''从左往右排列
IsX = (12 + count2 * IS_Width) + (count2 * 10)
IsY = (count1 * IS_Height) + (count1 * 10)
pbox.SetBounds(IsX, IsY, IS_Width, IS_Height)
Next
Next
二维码显示如下:显示比例不对,正方形的二维码只显示一半。
|