翻转图片
Dim sp AsBooleanDim cz AsBooleanPrivateSub Command1_Click(Index AsInteger)
Dim pic As StdPicture
Dim w, h AsInteger
w = Picture1.Width
h = Picture1.Height
Set pic = Picture1.Picture
Picture1.Cls
SelectCase Index
Case0
sp = Not sp
Case1
cz = Not cz
Case2EndendselectIf sp And cz Then
Picture1.PaintPicture pic, w, h, w * -1, h * -1ElseIf sp AndNot cz Then
Picture1.PaintPicture pic, w, 0, w * -1, h
ElseIfNot sp And cz Then
Picture1.PaintPicture pic, 0, h, w, h * -1Else
Picture1.PaintPicture pic, 0, 0EndIfEndSubPrivateSub commond2_Click()
CommonDialog1.FileName = ""
CommonDialog1.Filter = "图像文件|*.jpg;*.gif;*.png;*.PNG;*.bmp"
CommonDialog1.Flags = cdlOFNAllowMultiselect '这个选项可使多选,所以要对文件串进行处理。
CommonDialog1.ShowOpen
Dim a
a = Split(CommonDialog1.FileName, " ")
If UBound(a) = 0Then Picture1.Picture = LoadPicture(a(0))
If UBound(a) > 0Then Picture1.Picture = LoadPicture(a(0) & a(1))
If UBound(a) > 1Then Picture2.Picture = LoadPicture(a(0) & a(2))
If Err.Number = 481Then
MsgBox "请选择图片文件"EndIfEndSub