用釆一白叶窗的形式显示图像的万法,可以实现横同和纵同的显示 ‘横向扫描图像 Private Sub Command1 Click 设计步骤: On Error resume next Picture2 CIs 在窗体中创建两个大 Dim cstep, 1, cnum As Long 小相同的图片框 Picture2 Width= Picture1 Width picturebox),分别命 Picturel. Height- Picture l Height cstep=20 名为 picture cnum=Picture1 Scale Width/cstep 和 picture2,其中 picture For i=0 To cnum Step 2 Picture2 PaintPicture Picture1, i* cstep, 0, cstep, Picture 1. Height 图片 picture属性要指定 cstep, 0, cStep, Picture1 Height, VBSrcCopy 缩小窗体的宽度,使得 Forj=0 To 50000 picture不可见,然后创 建三个按钮,分别为 lext 1 command 1、 command2 For i=I To cnum Step 2 和 command3 Picture2 PaintPicture Picture1, i*cstep, 0, cstep, Picture 1. Heigh cstep, 0, cstep, Picture l Height, VBSrcCopy Forj=0To 50000 ext 1
设计步骤: 1. 在窗体中创建两个大 小相同的图片框 (picturebox),分别命 名为picture1 和picture2,其中picture1 的图片picture属性要指定, 缩小窗体的宽度,使得 picture1不可见,然后创 建三个按钮,分别为 command1、command2 和 command3 用来一百叶窗的形式显示图像的方法,可以实现横向和纵向的显示。 ‘横向扫描图像 Private Sub Command1_Click() On Error Resume Next Picture2.Cls Dim cstep, i, cnum As Long Picture2.Width = Picture1.Width Picture1.Height = Picture1.Height cstep = 20 cnum = Picture1.ScaleWidth / cstep For i = 0 To cnum Step 2 Picture2.PaintPicture Picture1, i * cstep, 0, cstep, Picture1.Height, _ i * cstep, 0, cstep, Picture1.Height, VBSrcCopy For j = 0 To 50000 Next j Next i For i = 1 To cnum Step 2 Picture2.PaintPicture Picture1, i * cstep, 0, cstep, Picture1.Height, _ i * cstep, 0, cstep, Picture1.Height, VBSrcCopy For j = 0 To 50000 Next j Next i End Sub
纵向扫描图像 Private Sub Command2 Click On Error resume next Picture2 CIs Dim cstep, 1, cnum As Long Picture2 Width= Picture1 Width Picturel. Height- Picture l Height cstep=20 cnum=Picture l ScaleHeight/cstep For i=0 To cnum Step 2 Picture2 PaintPicture Picture1,, i*cstep, Picture1 Width, cstep, 0 i*cStep, Picture l Width, cstep, VBSrcCopy Forj=0 To 50000 Next ext 1 For i=I To cnum Step 2 Picture2 PaintPicture Picture1,, 1*cstep, Picture1 Width, cstep, O 1*cStep, Picturel Width, cstep, VBSrcCopy For j=0 To 50000 Next End Sub
‘纵向扫描图像 Private Sub Command2_Click() On Error Resume Next Picture2.Cls Dim cstep, i, cnum As Long Picture2.Width = Picture1.Width Picture1.Height = Picture1.Height cstep = 20 cnum = Picture1.ScaleHeight / cstep For i = 0 To cnum Step 2 Picture2.PaintPicture Picture1, 0, i * cstep, Picture1.Width, cstep, 0,_ i * cstep, Picture1.Width, cstep, VBSrcCopy For j = 0 To 50000 Next j Next i For i = 1 To cnum Step 2 Picture2.PaintPicture Picture1, 0, i * cstep, Picture1.Width, cstep, 0,_ i * cstep, Picture1.Width, cstep, VBSrcCopy For j = 0 To 50000 Next j Next i End Sub
百叶窗效果显示图形 回[=m 回区 Hello Kitty Helle krete 水平垂直退出 垂直 退出 回N图垂直 水平 百叶窗效果显示
百叶窗效果显示