|
hacking the BITMAP structure |
roger levy
Member #2,513
July 2002
|
before i begin: 1) i don't care about portability. 2) i don't care about compatibility. |
Thomas Fjellstrom
Member #476
June 2000
|
the dat area needs to be that memory.. and the line pointers should be set accordingly. line[0] == dat, line[1] == dat+line_width*1, etc. -- |
Kitty Cat
Member #2,815
October 2002
|
Actually, it's: bmp = create_bitmap_ex(bmp_bpp, bmp_w, bmp_h); free(bmp->dat); bmp->dat = my_bitmap_data; for(i = 0; i < bmp->h;++i) bmp->line<i> = bmp->dat + bmp->w*(bmp_bpp+7)/8*i; If the bitmap structure has a pitch variable, you could use this: -- |
Korval
Member #1,538
September 2001
|
Quote: Actually, it's The debug builds of many compilers garbage free-ed memory to catch errors like this. |
roger levy
Member #2,513
July 2002
|
what is the pitch variable and why would some bitmaps have it and not others? |
spellcaster
Member #1,493
September 2001
|
It's due to memory alignment. -- |
|