Computer Science Canada

Transparent Picture Background/No Picture Background

Author:  SAValkyrie [ Sat Jan 12, 2013 4:50 pm ]
Post subject:  Transparent Picture Background/No Picture Background

So we are importing a bomberman explosion picture into our game. You know for every picture there are background right? Such as white, blue, etc. So we cropped that part out in photoshop and left it black. However when we saved a picture and imported into turing, the blank background that we cropped out reappears in the game, and we can see this ugly dotted botch stuff in our game execution menu. So we tried using Pic.SetTrasparentColour but we did not know how to make it work. So I was just wondering is there a way to make a white background make transparent or disappear when we import that picture into our game coding.

Author:  Insectoid [ Sat Jan 12, 2013 4:56 pm ]
Post subject:  RE:Transparent Picture Background/No Picture Background

Open the image in paint and pick your background color. Ideally, a color that isn't anywhere else in the image. Fill in all your background areas with this color, and save a .bmp. Most other formats will introduce compression artifacts into your image, and you'll end up with the ugly dotted botch stuff.

Once you've loaded your image in Turing (Pic.Load(), if I remember correctly), use Pic.SetTransparentColor(your_variable, background_color). When you draw your image, instead of using picCopy, use picMerge.


: