|
-
Jan 7th, 2001, 08:31 PM
#1
Thread Starter
New Member
I have used StretchBlt with some success on perfect stretches such as an image of 20,20 stretching to 40,40 but if I try and stretch it to 20,40 or something unsquare it fails. Also unsuccessful in shrinking with it. Is it something I'm doing wrong or is StretchBlt only capable of perfect stretching
-
Jan 8th, 2001, 03:26 PM
#2
Works fine for me.
Code:
Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
Private Sub Command1_Click()
AutoRedraw = True
StretchBlt hdc, 0, 0, 100, 150, Picture1.hdc, 0, 0, Picture1.Width / 15, Picture1.Height / 15, vbSrcCopy
Refresh
End Sub
If, for whatever reason, it still doesn't work for you, try using the PaintPicture method. It's quite similar.
-
Jan 11th, 2001, 12:04 PM
#3
PowerPoster
You might try using "SetStretchBltMode" Api call before calling "StretchBlt". Use "HalfTone" or "DeleteScans" parameter for "SetStretchBltMode"
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
|