x


crop an image from WWW

Is there a way to select and crop an area of an image downloaded using www class during run time? Ideally, I want to get the image, select the part I want using mouse coordinates (rect), and then apply that cropped image as texture to a cube or some other primitive object.

I have the www part and can apply the texture to my game object. What I would like to know is how to use the mouse to crop image before applying as texture. Can I access mouse coordinate when dealing with www image or texture?

Is this the right approach? Or is it better to apply the texture to a cube and then scale and offset the texture to show area you want? And are both options possible using mouse drag?

update: another approach i might try is to create a square based on two points given(GetMouseButtonDown and GetMouseButtonUp) based on raycast. Then that would be my hypotenuse. I could then try to get the rect from that. Then maybe somehow use the getpixel() get that area and apply that towards a new texture (setpixels).

Thanks in advance, Actionevent

more ▼

asked Apr 29 '12 at 06:13 AM

actionevent gravatar image

actionevent
1 1 1 2

(comments are locked)
10|3000 characters needed characters left

0 answers: sort newest
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2197
x54
x3

asked: Apr 29 '12 at 06:13 AM

Seen: 614 times

Last Updated: Apr 29 '12 at 06:23 PM