I am a stupid newbie. 
Author Message
 I am a stupid newbie.

   Question for all you smarter people out there.

   I am trying to copy a 1 pixel wide by 200 pixel high slice of a 200 x
200 picture into my offscreen buffer. I am also scaling it up or down
vertically (width will always be one pixel.) I am using drawpicture to
do this and I must be fouling something up because it spews garbage on
the screen. In some cases, this slice will be taller than the buffer I'm
copying it to. Does this function have trouble drawing outside the
buffer's dimensions?

   Is this making any sense to anyone? Help!

P.S. While we're at it, how would I get the pixel color of a certain
point in a picture I dragged into the project window? The infamous 200 x
200 picture from above. I want to copy it into a 200 x 200 array.

   I assume the array would be done as picture(200,200) as Color?

--
 --



Sun, 05 Oct 2003 11:37:44 GMT  
 I am a stupid newbie.

Quote:
> > I am trying to copy a 1 pixel wide by 200 pixel high slice of a 200 x
> > 200 picture into my offscreen buffer. I am also scaling it up or down
> > vertically (width will always be one pixel.) I am using drawpicture to
> > do this and I must be fouling something up because it spews garbage on
> > the screen.

> Garbage on the screen how? You mean when you show the offscreen buffer?

   Exactly.

Quote:
> No problem Im aware of, but you CAN specify a region that is out of bounds
> of the picture you are drawing from. Check your code and make sure where you
> are drawing from is completely in the picture. I've seen what you're talking
> about and its always been because of what I just said.

No. I am always copying a piece from 0y to 199y in the source image, and
the width is always 1 pixel.

Quote:
> Let me know if you get it working.

Thanks, sir.

--
 --



Sun, 05 Oct 2003 23:32:28 GMT  
 I am a stupid newbie.

Quote:



> > P.S. While we're at it, how would I get the pixel color of a certain
> > point in a picture I dragged into the project window? The infamous 200 x
> > 200 picture from above. I want to copy it into a 200 x 200 array.

> >    I assume the array would be done as picture(200,200) as Color?

> > --
> >  --

> Here's one i can answer... woo woo.. you'd use the rgbsurface property
> of the graphics once it's drawn in...
> dim rgb1,rgb2 as rgbsurface
> dim x,y as integer
> dim col(200,200) as color
> dim p as picture
> p = newpicture(1,200,screen(0).depth)
> rgb1 = Picture.rgbsurface
> rgb2 = p.rgbsurface
> for y = 1 to 200
> rgb2.pixel(1,i) = rgb1.pixel(1,i)
> col(0,y-1) = rgb.pixel(1,i)
> next
> for x = 2 to 199
>    for y = 0 to 199
>       col(x-1,y-1) = rgb1.pixel(x,y)
>     next
> next

> Hope that helps

> Eli

   Thank you all. The user/publisher support for RB has been awesome.
This is the best $100 I've spent in along time (other than those lap
dances, but...)

--
 --



Wed, 08 Oct 2003 10:38:43 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Stupid newb question: What am I doing wrong?

2. REPOST: I am a stupid forger

3. Stupid question I am afraid, but I could use a pointer or two

4. STUPID QUESTION I AM AFRA

5. I am clinically stupid. (fastcgi.rb bug)

6. Just starting -- am I stupid? (new and initialize)

7. Maybe I am just stupid... :(

8. REPOST: I am a stupid forger

9. Is Fortran great or am I stupid?

10. string random generator (Sorry if too stupid, but i am a beginner)

11. am I stupid

12. I am to stupid to embedd python - pls help

 

 
Powered by phpBB® Forum Software