Menu

#400 BitMapScale() gives wrong result for <=256 colour bitmaps

open
nobody
Libraries (47)
5
2012-03-30
2012-03-30
No

When using BitMapScale() with bitmaps of depth <=8 (and not friends with the screen), the result has SLIGHTLY the wrong horizontal scale. So the wrong result is most obvious with wide bitmaps. I have attached an example picture showing the incorrect result when scaling 1-bit masks (along with 24-bit pictures that are friends with the screen).

This has happened since at least Icaros 1.2.x, and is still present in Icaros v1.4, while using VESA graphics. My only work-around is to allocate two suitably-sized (non-friend) 24-bit bitmaps, blit the (in this case 1-bit mask) source bitmap into the first 24-bit bitmap, use BitMapScale() to scale it into the second 24-bit bitmap, and then finally blit the result back into the (in this case 1-bit mask) target bitmap... not very efficient!

Discussion

  • Chris Handley

    Chris Handley - 2012-03-30
     
  • Chris Handley

    Chris Handley - 2012-03-30

    I should add that working-around this is made even harder because of the BltBitMap() bug I reported (between 1-bit & 24-bit bitmaps). Originally I was reading & writing individual pixels (which is incredibly slow), but now I am using two PixelArrays (one char & one long) to perform each of the 'blits' (which is a lot faster, but uses even more memory!).

    Because of these two bugs, to scale a 1-bit mask I estimate that I'm temporarily using 88 times (!) the amount of memory that should be required!

     

Log in to post a comment.