News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Newbie - Bitmap source...

Started by Klint, September 07, 2005, 06:28:31 PM

Previous topic - Next topic

Klint

Can anybody supply me with the source for a most minimal win32 program that displays a bitmap (i.e. a bitmap being displayed in a window)? Nothing fancy or complicated.

Thankyou.

Clint.

Mark Jones

Hi Clint, do you have the MASM32 package? If so, look in \masm32\tutorial\icztutes\tut25
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

gavin

I'm not sure i'm missing the tut's on my masm install ?
But here is the link to it on Iczelion's site.

http://spiff.tripnet.se/~iczelion/tut25.html

Klint

Thankyou,

Yes I've looked at icezillion's - excuse spellings -  tutorial. It was not working for me before. I tryed to make it dislpay a different bitmap with no avail unfortunetly.

Thanks again for your posts!

I'll just stick at it.


P.S.

I've been trying to display a bitmap in a window using "C". But I got errors during compilation, a linker error regarding "BitBlt".

Do you think the two problems may be connected? In effect; its the same program I'm trying to write. And pretty much the same computer language.


Clint.

Tedd

One simple bitmap example...

if/when you get assemble errors, you'll note it complains about unknown functions. This is because the include/includelib lines at the top have no path - so it doesn't know where to find the import libraries.
Most often you can fix this by simply prepending the filenames with their absolute path, eg. "c:\masm32\include\kernel32.inc" for inc files, and "c:\masm32\lib\kernel32.lib" for lib files.


As for your C errors.. It's probably a similar problem to the one I've just mentioned (which is why I mentioned it :wink)
You need to check that "wingdi.h" is on your compile include path, and "gdi32.lib" for the linker.

[attachment deleted by admin]
No snowflake in an avalanche feels responsible.

Klint

Thankyou for your help. Now I'm pretty sure I'm doing something wrong.

So I downloaded your "bimp.zip". It was very helpful as it was nice and simple. I then delete the ".exe" file, to see if I could compile it myself. I got errors so where it said "include windows.inc", I'd change it too "include D:\masm32\include\windows.inc" etc. It compiled with no errors at all. I click "assemble and link" from the menu. I tried plenty of variations, I'm still not sure what I'm supposed to click :p. Compile resource file gave me errors, perhaps this helps?

Basically I can compile it, with no errors, but I get a windowmwith no picture in. Exactly the same as the "working" example ".exe" file except the bitmap is not shown.

Any ideas?

Many thanks,

Clint.


Vortex

Hi Klint,

Here is a similar method to display a bmp image without using resources.

[attachment deleted by admin]

Klint

Hiya,

Thanks for your help.

It seems I just can't get my head around bitmaps in either C or MASM32.

I think I'll try and do something a little less ambitious intill I get a little better.  :wink

Clint.