Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Couple of Questions
#1
Is there a function or whatever that returns the color of a given pixel?

I tried writing all the elements in an array used in GET to a file to 'save' an image, and then later read it all back into another array. When I used PUT, the image was fine except there were a few scattered pixels that were the wrong color. What am I doing wrong?

Thanks.
Reply
#2
thepixelcolor=POINT(x,y)
/post]
Reply
#3
attribute = POINT(X,Y)

where X and Y give the coordinates of the pixel you're interested in. As for your other problem, all I can think of without seeing your code is to say to make sure you're using INTEGER or LONG arrays. (The effect you mention can sometimes occur with SINGLE or DOUBLE arrays.)
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Reply
#4
Quote:I tried writing all the elements in an array used in GET to a file to 'save' an image, and then later read it all back into another array. When I used PUT, the image was fine except there were a few scattered pixels that were the wrong color. What am I doing wrong?

do you have a ", PSET" after your PUT???
If not, type this:

Code:
Put (x,y),array,pset

This should work[/quote]
B 4 EVER
Reply
#5
There's a faster way to do it Smile

Code:
'Initialize an offset array
DIM SHARED ysl(199) AS LONG
FOR k = 0
ysl(k) = k * 320&
NEXT

'Then, set segment to VGA memory (only for SCREEN 13)
DEF SEG = &HA000

'Now, to get any pixel, just use this:
colour = PEEK x + ysl(y)

Hope that helps.
am an asshole. Get used to it.
Reply
#6
Thanks guys. Appreciate your help! :bounce:
Reply
#7
SetVideoSeg.

:*)
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#8
*high fives rel* woooh, yeah! i was just about to say that!
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)