Results 1 to 2 of 2

Thread: Ahh! Help about StrechBlt Please!

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Location
    Sweden
    Posts
    37

    Unhappy

    If someone has used StrechBlt please respond and tell me how you used it!
    I tried to do exactly as shown on Windows API guide, but the compilator keeps complain about wrong number of arguments.

    If i got it right you write BitBlt(...) to use StrechBlt, just as with BitBlt, but with two extra args inserted.

    Code:
    'This declaration is in a module
    Public 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
    Public Const SRCCOPY = &HCC0020
    
    'And this is what I wrote in the picture1_click()
    
    Dim retval As Long
       retval = BitBlt(Picture2.hdc, 0, 0, 150, 150, Picture1.hdc, 0, 0, 100, 100, SRCCOPY)
    
    'Both pic-boxes are 300x300 and has Scalemode pixels
    I thought that the a piece (0,0-100,100) of the picture in pic-box #1 would land in pic-box #2 with the new size (0,0-150,150)
    But it doesn´t seem to work...
    You got any idea?

    One more thing...

    Why use StrechBlt in the first place when you can use an Imagecontrol with strech set to true?
    Is the APIs much faster?

    Thank you!
    Balder = Viking God
    VB6/VC++ Enterprise Editions

  2. #2

    Thread Starter
    Member
    Join Date
    Sep 2000
    Location
    Sweden
    Posts
    37

    Angry C´mon!

    There gotta be someone who has used StrechBlt !?!
    Balder = Viking God
    VB6/VC++ Enterprise Editions

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