-
What am I doing Wrong?
I am trying to use the StrechBlt Function, but nothing happens.
Code:
Option Explicit
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 Declare Function BitBlt Lib "gdi32" (ByVal hDestDC 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 dwRop As Long) As Long
Private Sub Form_Load()
picPreviewFront.Picture = frmMain.imgFront.Picture
StretchBlt picPreviewFront.hdc, 12288, 7380, ScaleWidth, ScaleHeight, frmPreviewFront.hdc, 12288, 7380, picPreviewFront.ScaleWidth, picPreviewFront.ScaleHeight, vbSrcCopy
End Sub
Private Sub mnuFileRefresh_Click()
Refresh
End Sub
-
The reason the BitBlt function is in there is because I am using it for my printing code, which I did not put in there.
-
Numero Uno (means number one):
I hate the Windows GDI functions. Strange enough, Windows was not designed for graphics!
Numero Dos (means number.... oh, you get it, do you?)
I have had a ***** with that StretchBlt .. I do not have the code at hand at the time of writing, but if you want a working example, I'll send you the code in a few days.
I need to get access to another machine to do so.
Something tells me, though, that you have to fiddle with the AutoRedraw properties.
-
I'd appreciate it if you sent me the working example. ty