Author Topic: No CLEARCOLOR on mode 33 graphics?  (Read 3169 times)

0 Members and 1 Guest are viewing this topic.

Offline MrFreyer

  • Newbie
  • Posts: 34
    • View Profile
No CLEARCOLOR on mode 33 graphics?
« on: October 31, 2019, 05:06:44 am »
Hi,

if I try to CLEARCOLOR a loaded mode 33 image, I get an Invalid Handle error.

Code: QB64: [Select]
  1. DIM imagehandle AS LONG
  2. imagehandle = _LOADIMAGE("test.png", 33)
  3. _CLEARCOLOR _RGB(255, 0, 255), imagehandle
  4.  

Is there a way to make colors transparent in hardware images?

Thanks


Marked as best answer by MrFreyer on October 31, 2019, 03:32:30 am

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: No CLEARCOLOR on mode 33 graphics?
« Reply #1 on: October 31, 2019, 06:43:09 am »
Hi. It is. First load image as software image, set transparency and then convert it to hardware image:

Img = _LOADIMAGE ("image.jpg",32)
_CLEARCOLOR _RGB32(0,0,0), Img
ImgHard = _COPYIMAGE (Img, 33)

Or use _SETALPHA for setting transparency for more than 1 color.