FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   beginner - Duplicate Image Area
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: beginner - Duplicate Image Area  (Read 477 times)
100luz

WWW
beginner - Duplicate Image Area
« on: Feb 7th, 2003, 11:46pm »

Please excuse me, I'm just a designer with a very basic knowledge of programming.
 
I can't realize how to get a rectangular area of an image, and duplicate it in another part of the image.
I would appreciate your help. Best Regards, 100LUZiano
 

http://100luz.com.ar/
fry


WWW
Re: beginner - Duplicate Image Area
« Reply #1 on: Feb 9th, 2003, 4:57pm »

you can use the function image(BImage image, float x1, float y1, float x2, float y2, float u1, float v1, float u2, float v2) to do the drawing.
 
x1/y1/x2/y2 are the coordinates of the image to be drawn. u1/v1/u2/v2 are the coordinates of the sub-image that you want.. i.e. if the original image is 100x100, and you want the section from 20, 30 to 40, 50, this snippet would draw that small section and make it follow the mouse:
 
void loop() {
  imageMode(CENTER_DIAMETER);
  image(img, mouseX, mouseY, 20, 20,  20, 30, 40, 50);
}
 
100luz

WWW
Re: beginner - Duplicate Image Area
« Reply #2 on: Feb 10th, 2003, 6:11pm »

Thank You very Much. That worked perfectly.
Best Regards, 100LUZiano
 

http://100luz.com.ar/
100luz

WWW
Re: beginner - Duplicate Image Area
« Reply #3 on: Feb 10th, 2003, 6:20pm »

Another question, and i think this is related to getPixel, setPixel and pixels[] commands. I think the pixels[] command is what i'm looking for in this case, but could not manage to get a clear example of how it works, specially when trying to get a rectangular portion of the screen.
 
What if i want to duplicate not the previous clean image but the result of a previous duplications, to do iterations?.
 
 

http://100luz.com.ar/
REAS


WWW
Re: beginner - Duplicate Image Area
« Reply #4 on: Feb 13th, 2003, 5:28pm »

we're planning to implement:
copyPixel()
copyArea()
copyImage()
 
100luz

WWW
Re: beginner - Bad IMAGE rendering
« Reply #5 on: Feb 14th, 2003, 4:10am »

I've noticed that the strange line that are render in the exact middle of the screen (check this post for an example of the bug):
http://proce55ing.net/discourse/yabb/board_Proce55ing_software__bugs_action_display_num_1044901171.html
 
 only appears when rendering the image with the command image() and not when using System.arraycopy
 
Any noticed that distortion of the images rendered with image().
 

http://100luz.com.ar/
Pages: 1 

« Previous topic | Next topic »