PDA

Click to See Complete Forum and Search --> : Ahh! Help about StrechBlt Please!


Balder
Dec 30th, 2000, 10:14 AM
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.


'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
Dec 30th, 2000, 04:02 PM
There gotta be someone who has used StrechBlt !?!