Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 16:58 25 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Bug with blit and NOTBLACK?

Author Message
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 393
Posted: 01:29pm 09 May 2024
Copy link to clipboard 
Print this post

I am running version 5.07 firmware on my CMM2 Gen 2. I am trying to draw some icons that I created by reading the images from a BMP file into an offscreen page, and then blitting the icons from the offscreen page to the current onscreen page.

I am using the &B100 optional argument to blit to suppress copying transparent pixels, which for me are black ones. My icons have some regions that I want to look black, so I am coloring those regions rgb(NOTBLACK). I checked and this seems to be working: the value of rgb(NOTBLACK) is 251666432.

However, when the icons are displayed, the NOTBLACK regions are being treated as transparent, so they do not appear.

I am guessing that the problem may be that when I created the BMP file originally using SAVE IMAGE, it did not correctly save the NOTBLACK regions, but made then true black instead. Or possibly the problem happened with the LOAD BMP command. I know that blit works correctly.

Any clues?
-Bill
 
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 393
Posted: 02:22pm 09 May 2024
Copy link to clipboard 
Print this post

Ah, I found the problem! It turns out that in order to correctly save NOTBLACK to a BMP file and load it back in again from the file, you cannot use 8-bit colors. Changing to 16-bit colors with MODE 1,16 fixes it.

-Bill
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2127
Posted: 04:43pm 09 May 2024
Copy link to clipboard 
Print this post

 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024