|
-
Jul 7th, 2002, 08:36 PM
#1
Thread Starter
Registered User
[resolved] Help: StretchBlt results in empty .Picture property
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
Last edited by BeerBaron; Jul 7th, 2002 at 09:16 PM.
-
Jul 7th, 2002, 08:57 PM
#2
Frenzied Member
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.[b]Image[/b]
End Sub
MicroBasic
Dragon Shadow Trainer
There is no good or evil in the world...only programmers and fools .
-
Jul 7th, 2002, 09:16 PM
#3
Thread Starter
Registered User
son of a ***** it worked! thanks a lot!
so what is the difference between the .picture and the .image properties?
-
Jul 7th, 2002, 09:52 PM
#4
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|