pan

Delphi iOS and pan gesture - distance always zero

半城伤御伤魂 提交于 2019-12-24 04:03:08
问题 I have this (now working) code based on bits I picked up various places: procedure TFormMain.imgMapsGesture(Sender: TObject; const EventInfo: TGestureEventInfo; var Handled: Boolean); var LObj: IControl; LImage: TImage; W: Single; H: Single; begin LImage := nil; LObj := Self.ObjectAtPoint(ClientToScreen(EventInfo.Location)); if (LObj is TImage) and (LObj.Visible) then begin LImage := TImage(LObj.GetObject); if (LImage <> imgMaps) then LImage := nil ; end ; if LImage = nil then Exit ; if

Get image coordinates from mouse cursor position on screen (WPF Image control)

帅比萌擦擦* 提交于 2019-12-24 00:37:44
问题 I was looking for a solution to transparently add panning & zooming capability to a WPF Image control and I have found the solution https://stackoverflow.com/a/6782715/584180, developed by Wiesław Šoltés and Konrad Viltersten, which is outstanding. Now I would like to add a 'mouse click' event to the control so that I can the coordinates of the clicked point in the original image coordinate system, so I can use them to retrieve the pixel color. I understand there will be some rounding and if

Google Maps: Limit Panning

坚强是说给别人听的谎言 提交于 2019-12-23 08:46:18
问题 I'm trying to recreate the pan limit behavior as demonstrated here: http://econym.org.uk/gmap/example_range.htm Unfortunately, it's using the API version 2, instead of the current version 3. I'm updating the commands so that they are current, but I think I might have missed something because it's not working: <html> <body> <script type="text/javascript" src="http://meyouand.us/scripts/jquery-1.4.4.min.js"></script> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor

Google Maps: Limit Panning

雨燕双飞 提交于 2019-12-23 08:46:04
问题 I'm trying to recreate the pan limit behavior as demonstrated here: http://econym.org.uk/gmap/example_range.htm Unfortunately, it's using the API version 2, instead of the current version 3. I'm updating the commands so that they are current, but I think I might have missed something because it's not working: <html> <body> <script type="text/javascript" src="http://meyouand.us/scripts/jquery-1.4.4.min.js"></script> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor

Calculate correct cursor position with pan and zoom

不打扰是莪最后的温柔 提交于 2019-12-21 23:14:30
问题 I've been messing around with this problem for about an hour now. I have a viewport which supports panning and zooming, the panning is handled by storing an offset for the X and Y axis. The zoom is just a float going from 0.2 to 14. My problem is that I need to be able to place stuff where the user clicks in the viewport but when I zoom and pan the mouse coordinates are not correct. I haven't been able to figure out how to properly calculate the mouse coordinates. Here's an image showing what

google maps pan to

岁酱吖の 提交于 2019-12-21 14:06:27
问题 Been struggling all day with setting a pan to in google maps from a text link. It looks like the id of the map itself isnt being passed through to the function but I have tried a number of things with no joy. <script type="text/javascript"> var home = new google.maps.LatLng(4.915833, 10.195313); function initialize() { var myOptions = { zoom: 2, center: home, mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: false, panControl: true, panControlOptions: { position: google.maps

UIPanGestureRecognizer does not switch to state “End” or “Cancel” if user panned x and y in negative direction

坚强是说给别人听的谎言 提交于 2019-12-21 07:22:55
问题 I've got a little problem with the UIPanGestureRecognizer. The Recognizer does not report the UIGestureRecognizerStateEnded state if the user panned to the top left (means negative x and y directions) The state changes to UIGestureRecognizerStateEnded if any direction is positive when the user lifts his finger, but it just ceases to report actions if both directions are negative or zero. This is bad because i hide some overlay views as long as the user drags something around and those views

D3 force layout: making pan on drag (zoom) smoother

懵懂的女人 提交于 2019-12-21 04:16:11
问题 I've got a d3.js static force layout graph that can get rather big (sometimes parts of it are clipped), so I'd like to let the user pan the whole graph by dragging. I don't think I need dragging of individual nodes, I've got a feeling that's just going to be confusing, but would like to make it possible to show the parts of the graph that are clipped by the svg boundaries. I've got a minimal example at http://bl.ocks.org/3811811 which uses visF.append("rect") .attr("class", "background")

Pinch Zoom and Pan

一笑奈何 提交于 2019-12-20 07:13:41
问题 I have an activity with LinearLayout as its main Layout. In that layout, there is a button that adds a View (R.layout.motor_block) to the main layout (R.id.layout): LayoutInflater inflater = (LayoutInflater)this.getSystemService( Context.LAYOUT_INFLATER_SERVICE ); View iv = inflater.inflate( R.layout.motor_block, null ); RelativeLayout rl = (RelativeLayout) findViewById(R.id.layout); rl.addView(iv); This works fine, but when I add more Views, the screen gets filled up with them so I need a

How does zooming, panning and rotating work?

…衆ロ難τιáo~ 提交于 2019-12-19 17:44:20
问题 Using OpenGL I'm attempting to draw a primitive map of my campus. Can anyone explain to me how panning, zooming and rotating is usually implemented? For example, with panning and zooming, is that simply me adjusting my viewport? So I plot and draw all my lines that compose my map, and then as the user clicks and drags it adjusts my viewport? For panning, does it shift the x/y values of my viewport and for zooming does it increase/decrease my viewport by some amount? What about for rotation?