|
Re: problem with pixel_for_bmap
[Re: sivan]
#403341
06/18/12 16:16
06/18/12 16:16
|
Joined: Aug 2005
Posts: 238
Caermundh
OP
Member
|
OP
Member
Joined: Aug 2005
Posts: 238
|
ok! thanks! that fixed it - part of my problem was that "my_bmap.tga" was 24 bit and the createblack bmap was 32 - changed the create black to 24, flipped count and count2, and put in the wait(1); - all of that fixed that problem.
It never even occured to me to check the bit depth of the maps - when i bmap locked them it returned 8888 for both so i figured they were the same.
(the bmap lock is a typo. i did have bmap_lock(panel_one.bmap,0) - my bad)
heres the code that works:
panel_one.bmap = bmap_create("cb_iconbox_md.tga"); wait(1); panel_two.bmap = bmap_createblack(bmap_width(panel_one.bmap),bmap_height(panel_one.bmap),24); wait(1); bmap_lock(panel_one.bmap,0); bmap_lock(panel_two.bmap,0); count = 0; while(count<bmap_height(panel_one.bmap)) { count2 = 0; while(count2<bmap_width(panel_one.bmap)) { pixel = pixel_for_bmap(panel_one.bmap,count2,count); pixel_to_bmap(panel_two.bmap,count2,count,pixel); count2 += 1; } count += 1; } bmap_unlock(panel_one.bmap); bmap_unlock(panel_two.bmap);
|
|
|
|