Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Partial Transparancy of Imported Images - How?
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
BigSams




PostPosted: Wed Jun 15, 2011 5:09 pm   Post subject: Partial Transparancy of Imported Images - How?

So my space shooter vs. alien game is working pretty much perfectly but with vb6 animations.
The final assignment is to convert it to a game with imported images.

Here is the problem: I don't know how to import in images that are partially transparent, like a circle. Heck, I'm not even sure which software to use to create them. Normally I use CorelDraw or Paint, but I don't know if they have that export feature.

Any links (nothing too hard..), syntax/code, instructions would be hepful.

P.S. unless you are aware of a very good plug-in, GIFs are not a good idea because they slow down the program a LOT - I tried last semester.

EDIT: just to be clear, partially transparent here is a circle with the rest of the square around it being transparent.
Sponsor
Sponsor
Sponsor
sponsor
RandomLetters




PostPosted: Wed Jun 15, 2011 5:22 pm   Post subject: RE:Partial Transparancy of Imported Images - How?

When drawing the picture, use the picMerge option.

[tdoc]pic.settransparentcolor[tdoc]
BigSams




PostPosted: Wed Jun 15, 2011 5:27 pm   Post subject: Re: Partial Transparancy of Imported Images - How?

So the syntax is picname.settransparentcolor = vbcolor ? Hmm but lets say that you want to get rid of the unwanted black around the circle, but there is wanted black within it as well?

Is there a way of creating a pic that is defined as transparent in a certain area, and vb can detect it (automatically or through extra settings/code, either way is ok)?
RandomLetters




PostPosted: Wed Jun 15, 2011 7:07 pm   Post subject: RE:Partial Transparancy of Imported Images - How?

Wow I just realized this is vb. Sorry, LOL. It's so rare for someone to post in this forum.

What you're looking for is the alpha channel.

http://en.wikipedia.org/wiki/Alpha_compositing

Most picture formats have alpha channels, which state the opacity of the pixel.

I'm not sure how paint can create those images but if you use something similar to photoshop, it's really obvious how it works (the checkerboard means transparent). PNG formats work well.
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: