locked
[UWP][WP8] Clipping the Image on Screen RRS feed

  • Question

  • I have an Image that can be scaled, translated and rotated. Generally speaking the transformed image will be larger than the original and the screen will only be displaying a portion of the original image.

    How can I copy just the screen area of the transformed image to a new image ?

    TIA

    Tuesday, February 21, 2017 12:56 PM

All replies

  • You could use RectangleGeometry to clip current window bound image.

    See this thread: http://stackoverflow.com/questions/29009358/clipping-using-rectangle-geometry-in-winrt-application#

    Wednesday, February 22, 2017 10:01 AM
  • This solution appears to get the rectangle from an image click.  I have no image click, so how to find the top left point on the image in relation to the screen ?
    Wednesday, February 22, 2017 12:26 PM
  • If the app runs on windows 10 mobile, the "Window.Current.CoreWindow.Bounds" should work.

    But I've tried it on windows desktop mode, it always return current screen's size. So in desktop mode, it will not work.

    I know that in windows phone 8.1, you could use ScreenCapture Class, but in UWP and wp8, I'm afraid there're no other ways.


    • Edited by jerryaqw Sunday, February 26, 2017 8:48 AM
    Sunday, February 26, 2017 8:38 AM
  • I was wondering if by investigating the transforms applied to the image, could they not be used to implement something in code behind to grab only the visible bounds ? 
    Monday, March 6, 2017 6:05 PM