flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Showing a bmp in 32 bit mode |
Author |
|
bogdanontanu 13 Jun 2005, 23:49
What eaxtly do you mean by "import it directly"
.BMP files have a format and the description of this format can be found on the internet. IF you can read files into memory THEN you can decode the BMP file structure (that is pretty simple) and paint the bitmap/pixels on screen. |
|||
13 Jun 2005, 23:49 |
|
Redragon 14 Jun 2005, 11:32
what i mean is, i think what your talking about, you create the bitmap file, then define the code to "import it directly" which is what you were saying about loading it into memory, then decoding the structure and painting it into memory.
|
|||
14 Jun 2005, 11:32 |
|
Dex4u 15 Jun 2005, 02:25
Dex4u's simple guide to displaying a 24bit BMP, first we will start with a 24bit bmp because they are simpler than 8bit bmp.
First thing at the start of the image is a header of about 54byte with info on things like: B M FileSize OffsetBits SizeHeader Width: Height: Planes BitCount Compression NumPaddedBytes The first thing you will notice is "B" "M" , as all bitmap files have two bytes with 'B' and 'M' at the start of the file, so we know its a BMP image file. Now for our demo lets say we know all the details of size etc. So we will jump over the header to where the image is, now the image is stored in a RGB format so we have 1 red byte, 1 green byte, and 1 blue byte, so each pixel is 3 bytes in size (or 24bits) so all you need do to display them is place them to a off screen buffer and then from a offscreen buff to screen. Now if it was only that simple , but we are programmers (asm programmer at that), so we know it is not going to be . So here some of the things to watch out for, first the image is stored up side down and second if you useing vesa some use 24bits and some use 32bits, so you need to test what is in "BitsPerPixel" in the vesa info if its 24bits you can put it in memory as it is, but if its 32bits and most are now, you need to add a byte to turn RGB to XRGB the X is just a byte of 0's, but it is needed to pad the 24bpp to 32bpp. And as a image format it does not come any easer that 24bit BMP, now if you want to decompress and display a jpeg thats when things start geting hard . |
|||
15 Jun 2005, 02:25 |
|
Octavio 15 Jun 2005, 13:22
Redragon wrote: or to use a seperate program and translate it into the db code (BINTODB).. No need to do that ,you can include a file in the program with 'incbin' directive. |
|||
15 Jun 2005, 13:22 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.