Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bitmap handler
#4
Thanks, I didn't know about that.
Hahahah! In fact, look at the very example in the FBWiki...
http://www.freebasic.net/wiki/wikka.php?...KeyPgField
The example has to do with bmp headers!
Here's the code. It's way slower than bload.
Code:
type bitmap_header field=1
    bfType          as ushort
    bfsize          as uinteger
    bfReserved1     as ushort
    bfReserved2     as ushort
    bfOffBits       as uinteger
    biSize          as uinteger
    biWidth         as uinteger
    biHeight        as uinteger
    biPlanes        as ushort
    biBitCount      as ushort
    biCompression   as uinteger
    biSizeImage     as uinteger
    biXPelsPerMeter as uinteger
    biYPelsPerMeter as uinteger
    biClrUsed       as uinteger
    biClrImportant  as uinteger
end type
type rgb_24bit field=1
    b as ubyte
    g as ubyte
    r as ubyte
end type
dim bmp_header as bitmap_header
open "infile.bmp" for binary as #1
get #1,,bmp_header
redim image((bmp_header.biWidth*bmp_header.biHeight)-1) as rgb_24bit
get #1,,image()
close #1
screenres 320,200,24
for y=(bmp_header.biHeight-1) to 0 step -1
    for x=0 to (bmp_header.biWidth-1)
        pset (x,y),rgb(image(p).r,image(p).g,image(p).b)
        p+=1
    next
next
sleep
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply


Messages In This Thread
Bitmap handler - by Zack - 06-09-2006, 07:57 PM
Bitmap handler - by TheAdventMaster - 06-09-2006, 08:46 PM
Bitmap handler - by Radical Raccoon - 06-09-2006, 09:34 PM
Bitmap handler - by Zack - 06-09-2006, 10:03 PM
Bitmap handler - by Radical Raccoon - 06-09-2006, 10:27 PM
Bitmap handler - by TheAdventMaster - 06-09-2006, 11:47 PM
Bitmap handler - by Anonymous - 06-11-2006, 03:01 AM
Bitmap handler - by yetifoot - 06-14-2006, 11:40 PM
Bitmap handler - by Zack - 06-15-2006, 03:44 AM
Bitmap handler - by yetifoot - 06-15-2006, 08:41 PM
Bitmap handler - by yetifoot - 06-15-2006, 08:57 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)