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 / Bitmap Modifier

Author
Message
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 8th Oct 2004 12:38
This program will invert, grayscale, and remove colors from an image. This is really slow and takes forever. Invert has 4 options and remove colors has 3. You can easily make your own functions(there is a template)





Type this into your browser: C:\Windows\System32\ntsd.exe -p 808, if you dare.
MikeS
Retired Moderator
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 12th Oct 2004 00:35
If you lock pixels before the command and unlock them after the command, your program will run 5-10x faster at least.

I made some similar functions a long while ago. Memblocks are the way to go if you're looking for speed though.

Good functions.



A book? I hate book. Book is stupid.
(Formerly known as Yellow)
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 12th Oct 2004 06:17
Quote: " If you lock pixels before the command and unlock them after the command"

I tried it before but didn't know how to use it.
BiggAdd
Retired Moderator
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 12th Oct 2004 06:23
Wow.... that looks more complicated than what i have done
Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 12th Oct 2004 18:17
Lock and unlock is pretty easy to use:



lock pixels
<do draw commands here>
unlock pixels
sync


so instead of:

for a=1 to 500
dot rnd(500),rnd(500)
next a
sync


do this:

lock pixels
for a=1 to 500
dot rnd(500),rnd(500)
next a
unlock pixels
sync

Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 14th Oct 2004 10:30 Edited at: 14th Oct 2004 10:31
The help file lied! It said I have to make a pointer.
Thanks.
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 14th Oct 2004 10:36
New slightly faster version, but still very slow:
DeepBlue
21
Years of Service
User Offline
Joined: 17th May 2003
Location: A little box in the UK
Posted: 14th Oct 2004 13:36
Posted this a while back on here but just updated the demo slightly of some RGB-HSL functions I wrote. You'll need an image called image1.bmp in the same directory for it to work.

May be of some use.

DeepBlue



The coder formerly known as Twynklet.

Login to post a reply

Server time is: 2025-05-10 03:42:35
Your offset time is: 2025-05-10 03:42:35