-
Hi,
Does someone know how I can make open, SAVE AS and UNDO options in my paint program? (Code or examples). I want to specify the SAVE AS so that it saves the picture is saved in *.bmp format.
I know how to make the menu but the functionality is missing...
-Maarit :)
-
CommonDialog
For the SaveAs you could probably go:
Code:
CommonDialog1.FileName="*.bmp"
CommonDialog1.ShowSave
Call SavePicture(Picture1.Picture,CommonDialog1.Filename)
For Open:
Code:
CommonDialog1.Filename="*.bmp"
CommonDialog.ShowOpen
Picture1.Picture=LoadPicture(CommonDialog.Filename)
For Undo (i'm not usre if this will work, it works with textboxes)
Code:
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Const Em_Undo = &HC7
Call SendMessage(Picture1.hwnd,EM_Undo,0&,0&)
-
Nope, the last wont work, because EM messages are strictly for Edits and Textboxes (not RTBs though)
-
For undo use this
WM_UNDO will work
Code:
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( _
ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any) As Long
Public Const WM_UNDO = &H304
Private Sub cmdUndo_Click()
SendMessage page.hWnd, WM_UNDO, 0, 0
End Sub
'Code improved by vBulletin Tool (Save as...)