Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OnScreenDraw
#1
;draw icon
int hicon=GetFileIcon("$qm$" 0 1)
DrawIconEx hdc cx/2-16 40 hicon 32 32 0 0 3
DestroyIcon hicon

how do i draw a bitmap?
pi
#2
BitBlt. Look in MSDN.

Function dlg_image_preview
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

if(!ShowDialog("" &dlg_image_preview)) 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 "Open..."
;END DIALOG
;DIALOG EDITOR: "" 0x2030000 "" "" ""

ret
;messages
__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)
,RECT r; GetClientRect hDlg &r; FillRect dc &r GetSysColorBrush(COLOR_BTNFACE)
,BITMAP b; GetObjectW mb.bm sizeof(BITMAP) &b
,BitBlt dc 100 10 b.bmWidth b.bmHeight 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
,mb.Attach(LoadPictureFile(_s))
,RedrawWindow hDlg 0 0 RDW_INVALIDATE
,
,case IDOK
,case IDCANCEL
ret 1
#3
huiiiiiiiiiiii. wow!
pi


Forum Jump:


Users browsing this thread: 2 Guest(s)