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.

Work in Progress / Tinkering about with Images (and Bitmaps) using Memblocks....

Author
Message
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 25th Sep 2006 00:05 Edited at: 25th Sep 2006 00:09
I attach below some (quite a few!) functions for mucking around with images at pixel / alpha level using memblocks...



some of you may find it of some use.... some not.

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 25th Sep 2006 01:35 Edited at: 25th Sep 2006 01:48
Some folk may find some of those functions useful. However, I noticed that you often check to see if memblock 100 (or 200(or 300(or 400))) exists and if it does then you delete it because your function needs it!
May I suggest that you search for a free memblock instead of deleting a memblock that the user (or in this case - coder) may find vitally useful and really doesn't want to be deleted.


Also, your function to copy a bitmap already exists as a DBP command. Check out the Copy Bitmap command (it also allows images to be scaled it the bitmaps are of unequal sizes).


Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 25th Sep 2006 10:08
@ Scraggle,

Thanks for the feedback. You're quite right. Made the memblock numbers very high so as to avoid program memblocks. However, could do a search routine (within a certain bracket) for free memblocks. Actually, now I seem to think about it IanM had a free dll to do just that...

I suppose the notional programmer could adjust the memblock numbers as well to suit.

With the CopyBmp command I was just getting carried away.

Before I got going on this I was really just after a few commands to allow me to draw or get colour at pixel within images...

Just a thought - if I alter an image using the above functions, what happens to that same image as utilised in a sprite - (is the image data in the sprite now independent)? if yes, thought so, if no, couldnt I write a function for sprite collision?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 25th Sep 2006 23:25
Nice set of commands Duffer


Making better games everday!
Oh yeah and just so you know its Oh-nek-a not One-ka!
Azrael
19
Years of Service
User Offline
Joined: 2nd Mar 2005
Location: Germany
Posted: 27th Sep 2006 23:29
A fast way of finding a free memblock..



Thanks for this set of functions anyway - takes me a lot of work.
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 28th Sep 2006 22:14
@ Azrael,

Cool - thanks

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 29th Sep 2006 11:53
Or a method that doesn't rely on random numbers



Hallowed are the ori.

Login to post a reply

Server time is: 2024-11-23 19:34:28
Your offset time is: 2024-11-23 19:34:28