I looked thru the tutorial for graphics stuff and the closest I could find was a bitmap scroller.

I want to display a jpeg instead of the large bitmap.
I looked thru Win 32 SDK but there isn't any reference to showing jpegs.

Thanks.

INVOKE CreateWindowEx,NULL,ADDR ClassName,ADDR AppName,\
WS_OVERLAPPEDWINDOW,0,0,1024,768,NULL,NULL,\
hInst,NULL



;INVOKE CreateWindowEx,NULL,ADDR ClassName,ADDR AppName,\ ; old stuff
; WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,\
; CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,NULL,NULL,\
; hInst,NULL
mov hwnd,eax
invoke ShowWindow, hwnd,SW_SHOWNORMAL
invoke UpdateWindow, hwnd
.while TRUE
invoke GetMessage, ADDR msg,NULL,0,0
.break .if (!eax)
invoke TranslateMessage, ADDR msg
invoke DispatchMessage, ADDR msg
.endw
mov eax,msg.wParam
ret
WinMain endp

WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
LOCAL ps:PAINTSTRUCT
LOCAL hdc:HDC
LOCAL hMemDC:HDC
LOCAL rect:RECT
.if uMsg==WM_CREATE
invoke LoadBitmap,hInstance,IDB_MAIN
mov hBitmap,eax
.elseif uMsg==WM_PAINT
invoke BeginPaint,hWnd,addr ps
mov hdc,eax
invoke CreateCompatibleDC,hdc
mov hMemDC,eax
invoke SelectObject,hMemDC,hBitmap
invoke GetClientRect,hWnd,addr rect
invoke BitBlt,hdc,0,0,rect.right,rect.bottom,hMemDC,0,0,SRCCOPY
invoke DeleteDC,hMemDC
invoke EndPaint,hWnd,addr ps
.elseif uMsg==WM_DESTROY
invoke DeleteObject,hBitmap
invoke PostQuitMessage,NULL
.ELSE
invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret
.ENDIF
xor eax,eax
ret
WndProc endp
Posted on 2004-02-22 16:41:26 by skywalker
In case you want to load a JPEG from your resources, the following calls are necessary:

FindResource, SizeOfResource, LoadResource, LockResource
GlobalAllock, GlobalLock
CreateStreamOnHGlobal
OleLoadPicture

There's some stuff in masm32 somewhere, but it might only work for loading from files.

If you can't find anything (or get stuff working yourself from looking up the above mentioned routines in PlatformSDK), I could give you some additional help... but right now it's getting late and I don't feel like converting my C source to assembly :)
Posted on 2004-02-22 17:19:12 by f0dder