0
我在寫一個移動圖像的代碼。有用。 我需要移動後的絕對x,y 我怎麼得到它們? 謝謝 我的代碼只給我相關的幾點。 :uwp GetcurrentPoint圖像
private static void MyImage_PointerMoved(object sender, PointerRoutedEventArgs e)
{
Pointer ptr = e.Pointer;
if (ptr.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Mouse)
{
// To get mouse state, we need extended pointer details.
// We get the pointer info through the getCurrentPoint method
// of the event argument.
Windows.UI.Input.PointerPoint ptrPt = e.GetCurrentPoint(micky.MyImage);
var transform = (micky.MyImage.RenderTransform as CompositeTransform);
double imagex = e.GetCurrentPoint(micky.MyImage).Position.X;
double imageY = e.GetCurrentPoint(micky.MyImage).Position.Y;