Hi!
I'm having trouble making StretchBlt work as advertised. Consider the following code:
--------------------------
With frmPics.picLogo
StretchBlt picMain.hdc, 50, 50, .width, .height, .hdc, 0, 0, .width, .height, vbMergePaint
End With
--------------------------
This passes arguments that make it work just like BitBlt (i.e. no stretching, just a one for one).
Here's my problem:
--------------------------
'THIS WORKS:
Dim width As Long
Dim height As Long
width = frmPics.picLogo.width
height = frmPics.picLogo.height
With frmPics.picLogo
StretchBlt picMain.hdc, 50, 50, width, height, .hdc, 0, 0, .width, .height, vbMergePaint
End With
THIS DOES NOT:
Dim width As Long
Dim height As Long
width = frmPics.picLogo.width + 1
height = frmPics.picLogo.height + 1
With frmPics.picLogo
StretchBlt picMain.hdc, 50, 50, width, height, .hdc, 0, 0, .width, .height, vbMergePaint
End With
--------------------------
It doesn't seem to matter what I store into width and height, nothing gets painted if it is different than the source width and height. I've tried several different raster operations, AutoRedraw is True on all pictureboxes, refreshing pictureboxes only cause the first two examples to stop working (no change in the problem code), and I've simply run out of things to try. Examples on all websites seem to indicate I'm doing nothing wrong. Can anyone give any suggestions?
Thanks!
-Mike
Any man willing to sacrifice liberty for security deserves neither liberty nor security.
-Ben Franklin
I'm having trouble making StretchBlt work as advertised. Consider the following code:
--------------------------
With frmPics.picLogo
StretchBlt picMain.hdc, 50, 50, .width, .height, .hdc, 0, 0, .width, .height, vbMergePaint
End With
--------------------------
This passes arguments that make it work just like BitBlt (i.e. no stretching, just a one for one).
Here's my problem:
--------------------------
'THIS WORKS:
Dim width As Long
Dim height As Long
width = frmPics.picLogo.width
height = frmPics.picLogo.height
With frmPics.picLogo
StretchBlt picMain.hdc, 50, 50, width, height, .hdc, 0, 0, .width, .height, vbMergePaint
End With
THIS DOES NOT:
Dim width As Long
Dim height As Long
width = frmPics.picLogo.width + 1
height = frmPics.picLogo.height + 1
With frmPics.picLogo
StretchBlt picMain.hdc, 50, 50, width, height, .hdc, 0, 0, .width, .height, vbMergePaint
End With
--------------------------
It doesn't seem to matter what I store into width and height, nothing gets painted if it is different than the source width and height. I've tried several different raster operations, AutoRedraw is True on all pictureboxes, refreshing pictureboxes only cause the first two examples to stop working (no change in the problem code), and I've simply run out of things to try. Examples on all websites seem to indicate I'm doing nothing wrong. Can anyone give any suggestions?
Thanks!
-Mike
Any man willing to sacrifice liberty for security deserves neither liberty nor security.
-Ben Franklin