{"id":812,"date":"2010-09-08T00:00:00","date_gmt":"2010-09-07T15:00:00","guid":{"rendered":"http:\/\/localhost\/blog\/?p=798"},"modified":"2014-08-17T23:36:10","modified_gmt":"2014-08-17T14:36:10","slug":"%e7%84%a1%e9%a1%8c-27","status":"publish","type":"post","link":"https:\/\/denasu.com\/blog\/2010\/09\/diary812","title":{"rendered":"\u30db\u30a4\u30fc\u30eb\u62e1\u5927\u306e\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0"},"content":{"rendered":"<p>Google \u30de\u30c3\u30d7\u306a\u3093\u304b\u3067\u30db\u30a4\u30fc\u30eb\u3092\u56de\u3059\u3068\u30ba\u30fc\u30e0\u3059\u308b\u6a5f\u80fd\u3002\u3042\u308c\u3063\u3066\u73fe\u5728\u30de\u30a6\u30b9\u304c\u6307\u3057\u3066\u3044\u308b\u4f4d\u7f6e\u306f\u305d\u306e\u307e\u307e\u3067\u62e1\u5927\u7387\u3060\u3051\u304c\u5909\u308f\u308b\u306e\u3060\u304c\uff0c\u540c\u3058\u3053\u3068\u3092\u5b9f\u88c5\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u610f\u5916\u306b\u96e3\u3057\u3044\u3002\u5fd8\u308c\u305d\u3046\u306a\u306e\u3067\u30e1\u30e2\u3002<\/p>\n<p><a href=\"http:\/\/denasu.com\/blog\/wp-content\/uploads\/2010\/09\/2010090801.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1144\" src=\"http:\/\/denasu.com\/blog\/wp-content\/uploads\/2010\/09\/2010090801.png\" alt=\"2010090801\" width=\"484\" height=\"271\" \/><\/a><\/p>\n<p>\u56f3\u306f\u62e1\u5927\u7387R1\u304b\u3089\u62e1\u5927\u7387R2\u306b\u5909\u66f4\u3057\u305f\u3068\u304d\u306e\u4f8b\u3002\u5927\u304d\u306a\u56db\u89d2\u306f\u30de\u30c3\u30d7\u5168\u4f53\u3067\uff0c\u4e2d\u306e\u56db\u89d2\u306f\u30d3\u30e5\u30fc\u30dd\u30fc\u30c8\u3002\u62e1\u5927\u7387R1\u3067\u30de\u30a6\u30b9\u30ab\u30fc\u30bd\u30eb\u304c\u7d76\u5bfe\u5ea7\u6a19(Ax, Ay) \u76f8\u5bfe\u5ea7\u6a19(Rx,Ry)\u306b\u3044\u308b\u3068\u304d\uff0c\u62e1\u5927\u7387\u3092R2\u306b\u3057\u305f\u5834\u5408\u3092\u8003\u3048\u308b\u3002\u3053\u306e\u3068\u304d\uff0c\u30d3\u30e5\u30fc\u306e\u30b9\u30af\u30ed\u30fc\u30eb\u4f4d\u7f6e(Sx, Sy)\u3092\u3046\u307e\u304f\u3044\u3058\u3063\u3066\u3084\u308c\u3070\uff0c\u30d3\u30e5\u30fc\u304b\u3089\u306e\u76f8\u5bfe\u5ea7\u6a19(Rx,Ry)\u3092\u5909\u3048\u305a\u306b\u62e1\u5927\u3092\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002(Sx, Sy)\u306e\u6c42\u3081\u65b9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n<pre class=\"brush:plain\">\r\n(Sx', Sy') = (Ax', Ay') - (Rx, Ry)\r\n           = (Ax, Ay) * R2 \/ R1 - (Rx, Ry)\r\n<\/pre>\n<p>\u3067\u3053\u3053\u304b\u3089\u304cWPF\u306e\u5834\u5408\u3060\u304c\uff0cOnMouseWheel\u306e\u4e2d\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5b9f\u88c5\u3057\u3066\u307f\u305f\u3002_view\uff08ScrollViewer\u306a\u3069\uff09\u306e\u4e2d\u306b_map\uff08Canvas\u306a\u3069\uff09\u3092\u5165\u308c\u3066\u3044\u308b\u524d\u63d0\u3002_view\u3078\u306eGetPosition\u3068\u30b9\u30af\u30ed\u30fc\u30eb\u4f4d\u7f6e\u306fR1\u500d\u3057\u305f\u5024\u306b\u306a\u308a\uff0c_view\u306e\u4e2d\u8eab\u3078\u306eGetPosition\u306f\u62e1\u5927\u3059\u308b\u524d\u306e\u5024\u306b\u306a\u308b\u306e\u3067\u4e0a\u306e\u5f0f\u3068\u82e5\u5e72\u7570\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<pre class=\"brush:csharp\">\r\nprivate void OnMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)\r\n{\r\n    double a_x = e.GetPosition(_map).X;\r\n    double a_y = e.GetPosition(_map).Y;\r\n    double r_x = e.GetPosition(_view).X;\r\n    double r_y = e.GetPosition(_view).Y;\r\n\r\n    R_2 = R1 + e.Delta;\r\n\r\n    _view.ScrollToHorizontalOffset(a_x * R_2 - r_x);\r\n    _view.ScrollToVerticalOffset(a_y * R_2 - r_y);\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Google \u30de\u30c3\u30d7\u306a\u3093\u304b\u3067\u30db\u30a4\u30fc\u30eb\u3092\u56de\u3059\u3068\u30ba\u30fc\u30e0\u3059\u308b\u6a5f\u80fd\u3002\u3042\u308c\u3063\u3066\u73fe\u5728\u30de\u30a6\u30b9\u304c\u6307\u3057\u3066\u3044\u308b\u4f4d\u7f6e\u306f\u305d\u306e\u307e\u307e\u3067\u62e1\u5927\u7387\u3060\u3051\u304c\u5909\u308f\u308b\u306e\u3060\u304c\uff0c\u540c\u3058\u3053\u3068\u3092\u5b9f\u88c5\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u610f\u5916\u306b\u96e3\u3057\u3044\u3002\u5fd8\u308c\u305d\u3046\u306a\u306e\u3067\u30e1\u30e2\u3002 \u56f3\u306f\u62e1\u5927\u7387R1\u304b\u3089\u62e1\u5927\u7387R2\u306b\u5909\u66f4\u3057\u305f\u3068\u304d\u306e\u4f8b\u3002\u5927\u304d\u306a\u56db\u89d2\u306f\u30de\u30c3\u30d7\u5168\u4f53\u3067\uff0c\u4e2d\u306e\u56db\u89d2\u306f\u30d3\u30e5\u30fc\u30dd\u30fc\u30c8\u3002\u62e1\u5927\u7387R1\u3067\u30de\u30a6\u30b9\u30ab\u30fc\u30bd\u30eb\u304c\u7d76\u5bfe\u5ea7\u6a19(Ax, Ay) \u76f8\u5bfe\u5ea7\u6a19(Rx,Ry)\u306b\u3044\u308b\u3068\u304d\uff0c\u62e1\u5927\u7387\u3092R2\u306b\u3057\u305f\u5834\u5408\u3092\u8003\u3048\u308b\u3002\u3053\u306e\u3068\u304d\uff0c\u30d3\u30e5\u30fc\u306e\u30b9\u30af\u30ed\u30fc\u30eb\u4f4d\u7f6e(Sx, Sy)\u3092\u3046\u307e\u304f\u3044\u3058\u3063\u3066\u3084\u308c\u3070\uff0c\u30d3\u30e5\u30fc\u304b\u3089\u306e\u76f8\u5bfe\u5ea7\u6a19(Rx,Ry)\u3092\u5909\u3048\u305a\u306b\u62e1\u5927\u3092\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002(Sx, Sy)\u306e\u6c42\u3081\u65b9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002 (Sx&#8217;, Sy&#8217;) = (Ax&#8217;, Ay&#8217;) &#8211; (Rx, Ry) = (Ax, Ay) * R2 \/ R1 &#8211; (Rx, Ry) \u3067\u3053\u3053\u304b\u3089\u304cWPF\u306e\u5834\u5408\u3060\u304c\uff0cOnMouseWheel\u306e\u4e2d\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5b9f\u88c5\u3057\u3066\u307f\u305f\u3002_view\uff08ScrollViewer\u306a\u3069\uff09\u306e\u4e2d\u306b_map\uff08Canvas\u306a\u3069\uff09\u3092\u5165\u308c\u3066\u3044\u308b\u524d\u63d0\u3002_view\u3078\u306eGetPosition\u3068\u30b9\u30af\u30ed\u30fc\u30eb\u4f4d\u7f6e\u306fR1\u500d\u3057\u305f\u5024\u306b\u306a\u308a\uff0c_view\u306e\u4e2d\u8eab\u3078\u306eGetPosition\u306f\u62e1\u5927\u3059\u308b\u524d\u306e\u5024\u306b\u306a\u308b\u306e\u3067\u4e0a\u306e\u5f0f\u3068\u82e5\u5e72\u7570\u306a\u3063\u3066\u3044\u308b\u3002 private void OnMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e) { double a_x = e.GetPosition(_map).X; double a_y = e.GetPosition(_map).Y; double r_x = e.GetPosition(_view).X; double r_y = e.GetPosition(_view).Y; R_2 = R1 + e.Delta; _view.ScrollToHorizontalOffset(a_x [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-812","post","type-post","status-publish","format-standard","hentry","category-programming"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4ZThs-d6","_links":{"self":[{"href":"https:\/\/denasu.com\/blog\/wp-json\/wp\/v2\/posts\/812","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/denasu.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/denasu.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/denasu.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/denasu.com\/blog\/wp-json\/wp\/v2\/comments?post=812"}],"version-history":[{"count":5,"href":"https:\/\/denasu.com\/blog\/wp-json\/wp\/v2\/posts\/812\/revisions"}],"predecessor-version":[{"id":2603,"href":"https:\/\/denasu.com\/blog\/wp-json\/wp\/v2\/posts\/812\/revisions\/2603"}],"wp:attachment":[{"href":"https:\/\/denasu.com\/blog\/wp-json\/wp\/v2\/media?parent=812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/denasu.com\/blog\/wp-json\/wp\/v2\/categories?post=812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/denasu.com\/blog\/wp-json\/wp\/v2\/tags?post=812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}