Jump to content
  • 0

Everything is transparent when opening a .PAL file through PHP


Hyvraine

Question


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  133
  • Reputation:   14
  • Joined:  12/23/11
  • Last Seen:  

I use this code to unpack the pal file and make the pixel:

$color2 = unpack('H2', fread($this->pal, 0x01));

$bg_color = ImageColorAllocate($im,$rgb[0],$rgb[1],$rgb[2]);
if($color[1] == '00') ImageColorTransparent($im,$bg_color);
ImageSetPixel($im,$bg_length,$bg_y,$bg_color);

Everything is transparentttt whyyyyyy. My guess is that the 'index' or whatever you call it isn't incrementing or something.

I got it to display its palette table though. Any ideas?

I'm not really good with PHP, please halp.

Edited by kenshn111
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...