04-02-2008, 06:09 PM
Function Dialog55
If you need bitmap dimensions for calculations, use this:
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
if(!ShowDialog("Dialog55" &Dialog55)) ret
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Button 0x54032000 0x0 8 10 48 14 "Button"
;END DIALOG
;DIALOG EDITOR: "" 0x2030000 "" "" ""
ret
;messages
int x(100) y(10) wid(128) hei(128) ;;change this
__MemBmp-- mb
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
,
,case WM_PAINT
,PAINTSTRUCT p; int dc=BeginPaint(hDlg &p)
,BitBlt dc x y wid hei mb.dc 0 0 SRCCOPY
,EndPaint hDlg &p
,
ret
;messages2
sel wParam
,case 3
,if(!OpenSaveDialog(0 _s "bmp, jpg, gif[]*.bmp;*.jpg;*.gif[]")) ret
,int hb=LoadPictureFile(_s); if(!hb) ret
,hb=CopyImage(hb IMAGE_BITMAP wid hei LR_COPYDELETEORG|LR_COPYRETURNORG)
,mb.Attach(hb)
,RedrawWindow hDlg 0 0 RDW_INVALIDATE
,
,case IDOK
,case IDCANCEL
ret 1If you need bitmap dimensions for calculations, use this:
