0

Right now we are uploading images in a website using C# and it works great.

I now have a request to allow the user to put an arrow (overlay) on the image in a specifc part of the image to highlight a part of the image.

We are already adding text to the image on file upload but the text is always in the same spot, but we want the user to put the arrow wherever they want. And this would be POST upload. I.E user uploads image, we save it, the another user opens image and that is when we want to allow them to add the arrow, then re-save the image.

Any help would be appreciated

Brad
  • 3,454
  • 3
  • 27
  • 50

3 Answers3

1

You need javascript(or jquery) in client side to find out in which position is that arrow lays. Say, u got x-pos=100, y-pos=50, then pass those values to the server method which overlays that image in same position. There are bitmap like c# class which have number of methods to process images. You should rather check in msdn. I cannot write all code for youunfortunately. But, you got the idea. Didn't you?

asish
  • 32
  • 4
  • Yea I got the idea, and I thought of that, was just looking for something more speciific so the user could place the arrow exactly where they wanted (and move it around) but I can try it this way. Once I try it out will let you know how it goes. – Brad Nov 09 '12 at 12:50
0

You can use document.elementFromPoint method.
Use jQuery

jQuery(document.elementFromPoint(x, y)).click();

This can also help you with complete example.
How do I get the coordinates of a mouse click on a canvas element?

Community
  • 1
  • 1
ravidev
  • 2,708
  • 6
  • 26
  • 42
  • So this would give me the x and y axces where they user clicked the mouse and then I could add the arrow at that location? I thought of something like that but if I put the arrow there and they want to still view something (say to the left) of where the arrow is, and I put the arrow over that part of the image it wont work. Ideally I would like them to be able to add an arrow and drag it to where they want, if that is not possible then what you are suggesting would work. Do you have more details/more code for an example (I have not used much JQuery before). – Brad Nov 09 '12 at 12:40
0

It's not complete, do you have a ASP.NET website or website using Silverlight ? In the first situation, you need to use client technology like javascript, Jquery (as mentionned earlier) Flash, silverlight, etc. you have plenty of choices but the operation cannot be realised as server-part operation.

Giu
  • 1,832
  • 2
  • 16
  • 31