QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: MrFreyer on October 31, 2019, 05:06:44 am

Title: No CLEARCOLOR on mode 33 graphics?
Post by: MrFreyer 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

Title: Re: No CLEARCOLOR on mode 33 graphics?
Post by: Petr 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.