Results 1 to 3 of 3

Thread: StretchBlt

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Location
    Idaho
    Posts
    1

    Question

    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

  2. #2
    Guest
    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.

  3. #3
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    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
  •  



Click Here to Expand Forum to Full Width