|
-
Dec 8th, 2004, 03:14 AM
#1
Thread Starter
Junior Member
VB: SavePicture PictureBox -[RESOLVED]-
Hi
I am trying to save a picturebox into a ".bmp" file afterdrawing something on the picturebox, but it is not working for me. what I am getting is, a blank bitmap file with the same color as the background color of the picturebox, I am giving the code what I am doing to save the drawing
'***********************************************
Const SRCCOPY = &HCC0020 ' (DWORD) dest = source
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 Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1.PSet (X, Y)
End Sub
Private Sub Command1_Click()
StretchBlt Picture2.hdc, 0, 0, 100, 100, Picture1.hdc, 0, 0, 100, 100, SRCCOPY
End Sub
Private Sub Command2_Click()
SavePicture Picture2.Image, "c:\tp.bmp"
MsgBox ("Done")
End Sub
'***********************************************
can anyone help me to solve my problem.
kajol
Last edited by Electroman; Dec 9th, 2004 at 03:55 AM.
Reason: Added Language to title & Added Resolved to title.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|