I want to add a picture together at runtime.
Pic1
Pic2
Pic3
Bottom half of Pic1 + Pic2 + Top half of Pic 3
so it would be
buttomhalf(Pic1)
Pic2
tophalf(pic3)
How can I do this
Printable View
I want to add a picture together at runtime.
Pic1
Pic2
Pic3
Bottom half of Pic1 + Pic2 + Top half of Pic 3
so it would be
buttomhalf(Pic1)
Pic2
tophalf(pic3)
How can I do this
I haven't tested this, or even checked over it properly :p but something like this would add the pictures to a picture box name Picture4. It could be more effecient though:
VB Code:
Option Explicit 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 MergePics() Picture4.Cls Call BitBlt(Picture4.hDC, 0, 0, _ Picture1.ScaleWidth / Screen.TwipsPerPixelX, _ (Picture1.ScaleHeight / Screen.TwipsPerPixelY) / 2, _ Picture1.hDC, Picture1.ScaleWidth / Screen.TwipsPerPixelX, _ Picture1.ScaleHeight / Screen.TwipsPerPixelY, vbSrcCopy) Call BitBlt(Picture4.hDC, 0, Picture1.ScaleHeight / Screen.TwipsPerPixelY, _ Picture2.ScaleWidth, Picture2.ScaleHeight / Screen.TwipsPerPixelY, _ Picture2.hDC, 0, 0, vbSrcCopy) Call BitBlt(Picture4.hDC, 0, _ (Picture2.ScaleHeight / Screen.TwipsPerPixelY) + _ ((Picture1.ScaleHeight / Screen.TwipsPerPixelY) / 2), _ Picture3.ScaleWidth / Screen.TwipsPerPixelX, _ (Picture3.ScaleHeight / Screen.TwipsPerPixelY) / 2, _ Picture3.hDC, 0, 0, vbSrcCopy) If Picture4.AutoRedraw Then Picture4.Refresh End Sub