cymru_cowboy
asked on
Create an image of the form
Hi, is it possible to create an image of a form and save it as an image to go in a picture box or image control.
I was thinking there must be a priunt screen sort of command that could be sent a forms handle as an argument.
Hope it's as easy as that but I doubt it
Cheers
I was thinking there must be a priunt screen sort of command that could be sent a forms handle as an argument.
Hope it's as easy as that but I doubt it
Cheers
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Really sorry I haven't had a chance to test this code, I will be using it shortly however given half a chance. Until then I'll award the points to JNSTAUB for getting in their first.
But thanks to bobbit31 for the help as well
But thanks to bobbit31 for the help as well
Private Const SRCCOPY = &HCC0020 ' (DWORD) dest = source
Private Sub Command1_Click()
Dim retVal As Integer
Picture1.Visible = False
Picture1.AutoRedraw = True
Picture1.ScaleMode = 3
Picture1.Width = Me.ScaleWidth
Picture1.Height = Me.ScaleHeight
'' now write to Picture1r hdc
retVal = BitBlt(Picture1.hDC, 0, 0, Me.ScaleWidth, Me.ScaleHeight, _
Me.hDC, 0, 0, SRCCOPY)
Picture1 now holds the image of the form (make it visible if you want to see)