How can I get dynamic(?) start point for crop image? (Windows Phone)


  • I am working on making a cropping image page in windows phone 8.1. I just wanted to buy some crop image tool from telerik or component one or Syncfusion. but there won't be control for a while for Windows Universal App. So I decided to implement that behavior.

    I found some good sample code for cropping image. but most of sample's implementation are that Image is static(fixed) and move and resize the crop area(like RectangleGeometry?).

    But I want crop area(I use RectangleGeometry for that) fixed in the center of screen(I did it already) and Im moving image.

    So I need to calculate start point x , start point y position relative to image.

    How Can I do that?

    Please Help!

    Monday, November 03, 2014 4:07 PM

All replies

  • Can you please explain more clearly what you are trying to do and where you are blocked?

    You can convert coordinates between different UIElement's frames of reference with http://msdn.microsoft.com/en-us/library/windows/apps/xaml/windows.ui.xaml.media.visualtreehelper.findelementsinhostcoordinates.aspx .


    Tuesday, November 04, 2014 12:26 AM
  • Ok Here is my screen capture.

    There is a dimmed square in the screen which is RectangleGeometry that is used for cropping position and it is fixed position(actually center of screen).

    And There is Image control that show picture that will be cropped.(Source Image) and actually it is moving vertically if it is vertical image and move horizontally if it is horizontal image.

    Here is my crop method.

    Actual Crop Point(x,y) coordinates will actually change when I am moving image.

    I don't know how to get a coordinate.

    Sorry hard to explain. :(

    I hope you understand.

    Wednesday, November 05, 2014 4:32 AM
  • Hi Taedori,

    I'm not sure I understand, and it is hard to try to reproduce the problem with a picture of the code rather than with the code itself. Can you share a minimal sample that reproduces the problem?


    Saturday, November 08, 2014 1:43 AM