Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / GET IMAGE command updated to support transparency

Author
Message
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 10th May 2005 06:57
The problem with the GET IMAGE command is that if your image has various levels of transparency in it, when you use GET IMAGE all transparency is lost. You could use SET IMAGE COLORKEY but that only gets rid of the completely transparent areas and not the partially transparent bits.

So I've updated the command to allow you to do this.

Well ... kind of.

Sadly I don't know other languages so I can't turn this into a DLL
Anyway, here is a function that will grab an area of an image and retain transparency.

Syntax: GetImage(Image Number,New Image Number, Left, Top, Width, Height)

Enjoy




Coder formerly known as Scraggle
Ace Of Spades
20
Years of Service
User Offline
Joined: 6th Mar 2005
Location: Across the ocean
Posted: 10th May 2005 10:43 Edited at: 10th May 2005 10:43
Can't say I have ever dealt with the problem, as i rarely use GET IMAGE, but looks quite useful.

BatVink
Moderator
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th May 2005 20:42
The other thing that people may find useful here is how to deal with images in memblocks. It's a very handy technique to have in your toolkit.

BatVink
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 10th May 2005 23:05
It isn't necessary to understand memblocks at all inorder to use this function because it is all taken care of for you and an Image is made at the end.

However, it is always a good idea to offer instruction whenever needed and the best way I can do that is to provide a link to Phaelax's tutorial which is where I learned memblocks


Coder formerly known as Scraggle

Login to post a reply

Server time is: 2025-05-16 03:14:10
Your offset time is: 2025-05-16 03:14:10