|
Author |
Topic: beginner - Duplicate Image Area (Read 477 times) |
|
100luz
|
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
|
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
|
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
|
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
|
Re: beginner - Duplicate Image Area
« Reply #4 on: Feb 13th, 2003, 5:28pm » |
|
we're planning to implement: copyPixel() copyArea() copyImage()
|
|
|
|
|