VB Code:
Private Sub Command2_Click() z = 2 pic2.Height = pic1.Height / z pic2.Width = pic1.Width / z For x = 0 To pic2.Width For y = 0 To pic2.Height StretchBlt pic2.hdc, x, y, z, z, pic1.hdc, x * z, y * z, z, z, &HCC0020 Next y Next x pic2.Refresh Clipboard.SetData pic2.Picture End Sub
What the code above does is first resize the picturebox pic2 to be half the size of pic1, then copy the picture from pic1 to pic2 at half size. I use the for next loop rather than one StretchBlt because it yields better looking results.
My problem is when I want to copy the resulting picture to the clipboard pic2.Picture = 0. I don't think I full understand what StretchBlt is doing with the picture and/or video memory. Is there a way I can copy the result in pic2 to the clipboard.
any suggestions?
thanks




Reply With Quote