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.

Newcomers DBPro Corner / Lock Pixels?

Author
Message
Black Hydra II
20
Years of Service
User Offline
Joined: 26th Nov 2003
Location:
Posted: 20th Apr 2004 05:02 Edited at: 20th Apr 2004 05:53
Okay, I have begun working on a function that will take an area of the screen and blend it equally with a color as a parameter.

The code I currently have (in code attatchment), doesn't function at all. I am under the understanding that Lock Pixels can do better than point and dot, however I have no idea how it works or what it is supposed to do!

I tried at first to take the dword color data and get the average between that and the color parameter but that gave me some very funky results (looked like a weird tie die pattern). Then I tried averaging each color, however that causes my program to crash on running. I can't even hit the escape key!

Thanks in advance

EDIT -- Okay I did fix one problem in that I spaced out those several if statements over a few lines. Forgot that if I put a semicolon it would add to the stuff done in that if block. However it hasn't helped. I am DBPro FYI

"Damn had to remake account!" direct quotation from previous account.
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 20th Apr 2004 06:42
IF R3 > 255 THEN R3 = 255: IF G3 > 255 THEN G3 = 255: IF B3 > 255 THEN B3 = 255
IF R3 < 0 THEN R3 = 0: IF G3 > 0 THEN G3 = 0: IF B3 > 0 THEN B3 = 0

Try it with colons which should properly separate commands.
--
TAZ

Black Hydra II
20
Years of Service
User Offline
Joined: 26th Nov 2003
Location:
Posted: 20th Apr 2004 07:05
Thanks but it didn't work, unfortunately.

"Damn had to remake account!" direct quotation from previous account.
mR n
21
Years of Service
User Offline
Joined: 25th Jun 2003
Location:
Posted: 20th Apr 2004 07:27
unfortunately you haven't found out yet that dbpro doesn't like if-then statements on the same line. it just doesnt! caused me many hours of frustration! my advice would be to simply put them all on their own line or make them if-endif.

*or maybe my comp is just messed up...*
Black Hydra II
20
Years of Service
User Offline
Joined: 26th Nov 2003
Location:
Posted: 20th Apr 2004 07:30
Okay I am posting this to help people avoid wasting there time. Unfortunately noone read my edit post so they wasted there time.

All the IF THEN Statements are now on separate lines. It still doesn't work.

Sorry if that sounded rude but would rather save space for things that are relevant.

Thanks for your time, however.

"Damn had to remake account!" direct quotation from previous account.
fog
20
Years of Service
User Offline
Joined: 5th Oct 2003
Location: Newcastle, England
Posted: 20th Apr 2004 21:34
Hi Black Hydra II,

yeah you've used the variable "B" twice. Once for the FOR/NEXT loop and once for the blue colour component. Change the one for the loop and it should work fine.

And yeah simply add LOCK PIXELS before your FOR/NEXT loops and UNLOCK PIXELS after them for a speed boost.

Black Hydra II
20
Years of Service
User Offline
Joined: 26th Nov 2003
Location:
Posted: 20th Apr 2004 22:08
Thanks Fog.

I was almost positive I was doing something wrong with using the color commands. (My first time using them) I should have looked for the more obvious culprits more strenously.

"Damn had to remake account!" direct quotation from previous account.

Login to post a reply

Server time is: 2024-09-22 06:46:01
Your offset time is: 2024-09-22 06:46:01