Re: [MonoTouch] I want perform both Zoom and Rotate operations simultaneously
Off the cuff, I'd ask have you checked if either gesture recognizer cancels touches? -- View this message in context: http://monotouch.2284126.n4.nabble.com/I-want-perform-both-Zoom-and-Rotate-operations-simultaneously-tp4655829p4655848.html Sent from the MonoTouch mailing list archive at Nabble.com. ___ MonoTouch mailing list MonoTouch@lists.ximian.com http://lists.ximian.com/mailman/listinfo/monotouch
Re: [MonoTouch] I want perform both Zoom and Rotate operations simultaneously
A bit more on facilitating multi-gesture recognition... As with most things, when trying to c# IOS, some objective-C interpretation skill is required. Hope the below makes sense. Basically, you attach one recognizer as an observer of another - I ran into a similar problem long ago - unfortunately, I didn't save the code for handling it as I found a different solution - this comes from the Apple docs... It is possible with MT, hoping this is a point in the right direction for you. From this URL: http://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/GestureRecognizers/GestureRecognizers.html Permitting Simultaneous Gesture Recognition By default, no two gesture recognizers can attempt to recognize their gestures simultaneously. But you can change this behavior by implementing gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:, an optional method of the UIGestureRecognizerDelegate protocol. This method is called when the recognition of the receiving gesture recognizer would block the operation of the specified gesture recognizer, or vice versa. Return YES to allow both gesture recognizers to recognize their gestures simultaneously. -- View this message in context: http://monotouch.2284126.n4.nabble.com/I-want-perform-both-Zoom-and-Rotate-operations-simultaneously-tp4655829p4655849.html Sent from the MonoTouch mailing list archive at Nabble.com. ___ MonoTouch mailing list MonoTouch@lists.ximian.com http://lists.ximian.com/mailman/listinfo/monotouch
Re: [MonoTouch] I want perform both Zoom and Rotate operations simultaneously
Really-Really Sorry rnendel11 It just my mistake I paste wrong code snippet for *For Button Rotate* in my previous post so sorry the code for rotate on button click event is public float OnRotateClick (UIImageView imgview, float deg, string btnNames, out float _wdth, out float _hgt) { _wdth = imgview.Frame.Width; _hgt = imgview.Frame.Height; SizeF _imgFrameSize = new SizeF (Width, Height); imgview.Frame.Size = _imgFrameSize; if (btnNames == Rotate R) { Angle = deg + 90; imgview.Transform = CGAffineTransform.MakeRotation (Angle * (float)Math.PI / 180); return Angle; } else { Angle = deg - 90; imgview.Transform = CGAffineTransform.MakeRotation (Angle * (float)Math.PI / 180); return Angle; } } -- View this message in context: http://monotouch.2284126.n4.nabble.com/I-want-perform-both-Zoom-and-Rotate-operations-simultaneously-tp4655829p4655863.html Sent from the MonoTouch mailing list archive at Nabble.com. ___ MonoTouch mailing list MonoTouch@lists.ximian.com http://lists.ximian.com/mailman/listinfo/monotouch
[MonoTouch] I want perform both Zoom and Rotate operations simultaneously
Hi, I am trying to apply the Pinch Gesture Recognizer to UIImage while the same time means the zoom in or zoom out the image that time I want to rotate it with 90 deg with that zooming level but my problem is that , while applying rotate operation with zoom only rotate the image with its original scale. I want perform both Zoom and Rotate operations simultaneously. for rotate image i use the buttons to rotate image for zoom i use PinchGestureRecognizor code for PinchGestureRecognizor void ScaleImage (UIPinchGestureRecognizer gestureRecognizer) { AdjustAnchorPointForGestureRecognizer (gestureRecognizer); if (gestureRecognizer.State == UIGestureRecognizerState.Began || gestureRecognizer.State == UIGestureRecognizerState.Changed) { gestureRecognizer.View.Transform *= CGAffineTransform.MakeScale (gestureRecognizer.Scale, gestureRecognizer.Scale); // Reset the gesture recognizer's scale - the next callback will get a delta from the current scale. gestureRecognizer.Scale = 1f; imageForReset = gestureRecognizer.View; } } For Button Rotate void ScaleImage (UIPinchGestureRecognizer gestureRecognizer) { AdjustAnchorPointForGestureRecognizer (gestureRecognizer); if (gestureRecognizer.State == UIGestureRecognizerState.Began || gestureRecognizer.State == UIGestureRecognizerState.Changed) { gestureRecognizer.View.Transform *= CGAffineTransform.MakeScale (gestureRecognizer.Scale, gestureRecognizer.Scale); // Reset the gesture recognizer's scale - the next callback will get a delta from the current scale. gestureRecognizer.Scale = 1f; imageForReset = gestureRecognizer.View; } } -- View this message in context: http://monotouch.2284126.n4.nabble.com/I-want-perform-both-Zoom-and-Rotate-operations-simultaneously-tp4655829.html Sent from the MonoTouch mailing list archive at Nabble.com. ___ MonoTouch mailing list MonoTouch@lists.ximian.com http://lists.ximian.com/mailman/listinfo/monotouch