使用StretchBlt中的图象保存不住的问题
三控件,picture1,picture2,command2
Private Sub Command2_Click()
Dim w As Integer, h As Integer
Picture1.Picture = LoadPicture("g:\gg-manhuabao.jpg")
w = Picture1.Width
h = Picture1.Height
Picture2.Width = w * 1.2
Picture2.Height = h * 1.2
StretchBlt Picture2.hdc, 0, 0, w * 1.2, h * 1.2, Picture1.hdc, 0, 0, w, h, vbSrcCopy
SavePicture Picture2.Image, "g:\gg-manhuabao41.jpg"
End Sub
'结果就是保存出来的g:\gg-manhuabao41.jpg是一个空白的图,不知道为什么好象并没有把值付到PICTURE2上,只要我调用
picture2.refresh
或者我切换一下窗口,PICTURE2的图象就消失了