flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
AsmGuru62 11 Dec 2013, 18:27
How does "a.bmp" is described in your RC file?
Does it have a NAME (a string) or an ID? |
|||
![]() |
|
patchariadog 11 Dec 2013, 18:58
I was trying to just run it from a file because I did not know how to load it in a resource so a.bmp is a file next to the exe
|
|||
![]() |
|
revolution 11 Dec 2013, 19:05
Looking at the docs for "LoadImage":
Quote: lpszName |
|||
![]() |
|
patchariadog 11 Dec 2013, 19:50
i tried this but it still did not work
invoke LoadImageA,eax, "a.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE |
|||
![]() |
|
revolution 11 Dec 2013, 19:51
What is the error code returned from LoadImage?
|
|||
![]() |
|
baldr 11 Dec 2013, 20:08
patchariadog wrote: invoke LoadImageA,eax, "a.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE MSDN wrote: hinst [in, optional] ![]() |
|||
![]() |
|
AsmGuru62 11 Dec 2013, 20:10
You're almost done!
Just use 0 instead of EAX (1st param). |
|||
![]() |
|
patchariadog 11 Dec 2013, 20:49
this is what I got for the first part now but it still does not show it
Code: invoke GetModuleHandleA,0 invoke LoadImageA,0, "a.bmp", IMAGE_BITMAP, 0, 0,LR_LOADFROMFILE mov [bmpSource],eax invoke GetDC,0 invoke CreateCompatibleDC,eax mov [hdcSource],eax invoke SelectObject,[hdcSource], [bmpSource] thanks for the help |
|||
![]() |
|
revolution 11 Dec 2013, 21:11
What are the error codes from each of the API calls?
|
|||
![]() |
|
AsmGuru62 11 Dec 2013, 21:26
Please use a debugger in this case.
I do not see any issues here, except that "a.bmp" may be not in the current directory. Try a full path for this file. |
|||
![]() |
|
patchariadog 11 Dec 2013, 21:38
I tried the full path and it still does not work. how do I check the error codes I am using the fasmw ide
|
|||
![]() |
|
revolution 11 Dec 2013, 21:40
patchariadog wrote: how do I check the error codes I am using the fasmw ide |
|||
![]() |
|
patchariadog 11 Dec 2013, 22:30
how do I use messagebox if it is not crashing I am going to try using getlasterror but I never used this before
|
|||
![]() |
|
patchariadog 11 Dec 2013, 22:43
I wasnt sure if I was suppose to put the getlast error after each line of code or just the last one so here are the results
wm_create when I did just the last line it says good when I did all lines all lines say good except the last line says invalid handle wm_paint does not give me any messageboxes I don't know how to read these results so any help would be appreciated. thanks |
|||
![]() |
|
tthsqe 11 Dec 2013, 23:34
patchariadog,
I used bitmap in a 2D game a long time ago. Since the whole thing might be overkill, I included strip.asm that just displays the bitmap. The functions that you should see are Paint, RedoPaint, and CleanupPaint.
|
|||||||||||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.