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 / [DBP]Writing an image to memblock function

Author
Message
Madscientist
14
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 19th Aug 2010 17:08 Edited at: 21st Aug 2010 01:43
Here's a little function I wrote that pastes an image into an image memblock. Useful at many times.
Syntax- WriteImageToMemblock(Memblock,Image,XPosition,YPosition)


My computer surpasses all the technologies of the day. What computer do I have?

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 20th Aug 2010 23:50
Your function ignores the image's alpha channel.

You can probably drop the checks for if the position is less than or equal to 0, you'll never get a number less than 12 with that position calculation.


"Any sufficiently advanced technology is indistinguishable from magic" ~ Arthur C. Clarke
Madscientist
14
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 21st Aug 2010 01:44
There, added alpha and fixed the Pos>=0.

My computer surpasses all the technologies of the day. What computer do I have?

Login to post a reply

Server time is: 2024-04-24 02:37:39
Your offset time is: 2024-04-24 02:37:39