{"id":20,"date":"2006-11-30T22:08:37","date_gmt":"2006-11-30T13:08:37","guid":{"rendered":"http:\/\/dev.activebasic.com\/egtra\/?p=20"},"modified":"2011-05-12T02:17:17","modified_gmt":"2011-05-11T17:17:17","slug":"gdi-3-%e7%b7%9a%e3%82%92%e5%bc%95%e3%81%8f","status":"publish","type":"post","link":"https:\/\/dev.activebasic.com\/egtra\/2006\/11\/30\/20\/","title":{"rendered":"GDI+ (3) \u7dda\u3092\u5f15\u304f"},"content":{"rendered":"<p>\u524d\u56de\u4e88\u544a\u3057\u305f\u3068\u304a\u308a\u3001\u4eca\u65e5\u306f<a href=\"https:\/\/www.activebasic.com\/help_center\/articles\/win32\/step32\/index.html\">Win32\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8b1b\u5ea7 \uff5e Step32. \u30a2\u30ca\u30ed\u30b0\u6642\u8a08\u3092\u4f5c\u308b \uff5e<\/a>\u3092GDI+\u3067\u66f8\u304f\u3068\u3069\u3046\u306a\u308b\u304b\u3068\u3044\u3046\u8a71\u3067\u3059\u3002<\/p>\n<p><!--more--><\/p>\n<p>\u4f8b\u306b\u3088\u3063\u3066\u3001\u6bd4\u8f03\u306e\u305f\u3081GDI+\u306b\u66f8\u304d\u76f4\u3057\u305f\u3053\u3068\u4ee5\u5916\u306f\u305d\u306e\u307e\u307e\u306b\u3057\u3066\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre><code>Sub MainWnd_Paint(hdc As HDC)\r\n    Dim graphics As Graphics(hdc)\r\n    Dim pos As PointF\r\n    Dim rc As RECT\r\n    Dim CenterPos As PointF      '\u91dd\u306e\u4e2d\u5fc3\u4f4d\u7f6e\r\n    Dim Length_Second As Double  '\u79d2\u91dd\u306e\u9577\u3055\r\n    Dim Length_Minute As Double  '\u77ed\u91dd\u306e\u9577\u3055\r\n    Dim Length_Hour As Long      '\u9577\u91dd\u306e\u9577\u3055\r\n\r\n    GetClientRect(hMainWnd, rc)\r\n\r\n    '\u91dd\u306e\u4e2d\u5fc3\u4f4d\u7f6e\r\n    CenterPos.X = rc.right \/ 2\r\n    CenterPos.Y = rc.bottom \/ 2\r\n\r\n    '\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u5927\u304d\u3055\u3092\u3082\u3068\u306b\u3001\u79d2\u91dd\u3001\u77ed\u91dd\u3001\u9577\u91dd\u306e\u9577\u3055\u3092\u8a08\u7b97\r\n    If rc.right &gt; rc.bottom Then\r\n        Length_Second = rc.bottom \/ 2 - 2\r\n    Else\r\n        Length_Second = rc.right \/ 2 - 2\r\n    End If\r\n    Length_Minute = Length_Second\r\n    Length_Hour = Length_Minute * 0.70\r\n\r\n    '\u77ed\u91dd\r\n    If st.wHour = 12 Then st.wHour = 0\r\n    Dim penMinute As Pen(Color.FromArgb(255, 100, 0), 5.0)\r\n    pos.X = CenterPos.x + Length_Hour * Sin(st.wHour * PAI \/ 6 + st.wMinute * PAI \/ 360)\r\n    pos.Y = CenterPos.y - Length_Hour * Cos(st.wHour * PAI \/ 6 + st.wMinute * PAI \/ 360)\r\n    graphics.DrawLine(penMinute, CenterPos, pos)\r\n\r\n    '\u9577\u91dd\r\n    Dim penHour As Pen(Color.FromArgb(255, 0, 0), 2.0)\r\n    pos.x = CenterPos.x + Length_Minute * Sin(st.wMinute * PAI \/ 30 + st.wSecond * PAI \/ 1800)\r\n    pos.y = CenterPos.y - Length_Minute * Cos(st.wMinute * PAI \/ 30 + st.wSecond * PAI \/ 1800)\r\n    graphics.DrawLine(penHour, CenterPos, pos)\r\n\r\n    '\u79d2\u91dd\r\n    Dim penSecond As Pen(Color.FromArgb(255, 255, 255), 1.0)\r\n    pos.x = CenterPos.x + Length_Second * Sin(st.wSecond * PAI \/ 30)\r\n    pos.y = CenterPos.y - Length_Second * Cos(st.wSecond * PAI \/ 30)\r\n    graphics.DrawLine(penSecond, CenterPos, pos)\r\nEnd Sub<\/code><\/pre>\n<p>GDI+\u3067\u76f4\u7dda\u3092\u5f15\u304f\u306b\u306fGraphics\u30af\u30e9\u30b9\u306eDrawLine\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u3053\u306e\u5f15\u6570\u306b\u306f\u76f4\u7dda\u306b\u4f7f\u3046\u30da\u30f3\u3068\u958b\u59cb\u5ea7\u6a19\u30fb\u7d42\u4e86\u5ea7\u6a19\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u307e\u305f\u3001CreatePen\u95a2\u6570\u306e\u547c\u51fa\u306fPen\u30af\u30e9\u30b9\u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u306b\u4ee3\u308f\u308a\u307e\u3057\u305f\u3002\u8272\u6307\u5b9a\u3067\u306fColor\u30af\u30e9\u30b9\u306e\u9759\u7684\u30e1\u30bd\u30c3\u30c9FromArgb\u3092\u7528\u3044\u3066\u3044\u307e\u3059\u3002RGB\u3057\u304b\u6307\u5b9a\u3057\u3066\u3044\u307e\u305b\u3093\u304c\u3001FromArgb\u3067\u3059\u3002<\/p>\n<p>\u63cf\u753b\u306b\u95a2\u3059\u308b\u4e8b\u67c4\u306f\u3001GDI\u304cGDI+\u306b\u306a\u3063\u3066\u3082\u6839\u672c\u7684\u306a\u6982\u5ff5\u306f\u3042\u307e\u308a\u9055\u3044\u304c\u7121\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u305d\u3046\u3067\u306a\u3051\u308c\u3070\u3053\u3046\u3082\u7279\u306b\u8a9e\u308b\u3053\u3068\u304c\u7121\u3044\u3068\u3044\u3046\u306f\u305a\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u4eca\u65e5\u306f\u3053\u308c\u3067\u304a\u3057\u307e\u3044\u3067\u3059\u3002\u6b21\u56de\u306e\u66f4\u65b0\u306f1\u9031\u9593\u5f8c\u306e\u4e88\u5b9a\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u4e88\u544a\u3057\u305f\u3068\u304a\u308a\u3001\u4eca\u65e5\u306fWin32\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8b1b\u5ea7 \uff5e Step32. \u30a2\u30ca\u30ed\u30b0\u6642\u8a08\u3092\u4f5c\u308b \uff5e\u3092GDI+\u3067\u66f8\u304f\u3068\u3069\u3046\u306a\u308b\u304b\u3068\u3044\u3046\u8a71\u3067\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3],"tags":[89,53],"class_list":["post-20","post","type-post","status-publish","format-standard","hentry","category-ab","tag-activebasic-5-development","tag-gdiplus"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>GDI+ (3) \u7dda\u3092\u5f15\u304f - \u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d<\/title>\n<meta name=\"description\" content=\"\u524d\u56de\u4e88\u544a\u3057\u305f\u3068\u304a\u308a\u3001\u4eca\u65e5\u306fWin32\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8b1b\u5ea7 \uff5e Step32. \u30a2\u30ca\u30ed\u30b0\u6642\u8a08\u3092\u4f5c\u308b \uff5e\u3092GDI+\u3067\u66f8\u304f\u3068\u3069\u3046\u306a\u308b\u304b\u3068\u3044\u3046\u8a71\u3067\u3059\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dev.activebasic.com\/egtra\/2006\/11\/30\/20\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GDI+ (3) \u7dda\u3092\u5f15\u304f - \u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d\" \/>\n<meta property=\"og:description\" content=\"\u524d\u56de\u4e88\u544a\u3057\u305f\u3068\u304a\u308a\u3001\u4eca\u65e5\u306fWin32\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8b1b\u5ea7 \uff5e Step32. \u30a2\u30ca\u30ed\u30b0\u6642\u8a08\u3092\u4f5c\u308b \uff5e\u3092GDI+\u3067\u66f8\u304f\u3068\u3069\u3046\u306a\u308b\u304b\u3068\u3044\u3046\u8a71\u3067\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dev.activebasic.com\/egtra\/2006\/11\/30\/20\/\" \/>\n<meta property=\"og:site_name\" content=\"\u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ysk.noh\" \/>\n<meta property=\"article:published_time\" content=\"2006-11-30T13:08:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2011-05-11T17:17:17+00:00\" \/>\n<meta name=\"author\" content=\"egtra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@egtra\" \/>\n<meta name=\"twitter:site\" content=\"@egtra\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"egtra\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dev.activebasic.com\/egtra\/2006\/11\/30\/20\/\",\"url\":\"https:\/\/dev.activebasic.com\/egtra\/2006\/11\/30\/20\/\",\"name\":\"GDI+ (3) \u7dda\u3092\u5f15\u304f - \u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d\",\"isPartOf\":{\"@id\":\"https:\/\/dev.activebasic.com\/egtra\/#website\"},\"datePublished\":\"2006-11-30T13:08:37+00:00\",\"dateModified\":\"2011-05-11T17:17:17+00:00\",\"author\":{\"@id\":\"https:\/\/dev.activebasic.com\/egtra\/#\/schema\/person\/8de756b2ff20b964f64594dfe8f18164\"},\"description\":\"\u524d\u56de\u4e88\u544a\u3057\u305f\u3068\u304a\u308a\u3001\u4eca\u65e5\u306fWin32\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8b1b\u5ea7 \uff5e Step32. \u30a2\u30ca\u30ed\u30b0\u6642\u8a08\u3092\u4f5c\u308b \uff5e\u3092GDI+\u3067\u66f8\u304f\u3068\u3069\u3046\u306a\u308b\u304b\u3068\u3044\u3046\u8a71\u3067\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/dev.activebasic.com\/egtra\/2006\/11\/30\/20\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dev.activebasic.com\/egtra\/2006\/11\/30\/20\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dev.activebasic.com\/egtra\/2006\/11\/30\/20\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u30db\u30fc\u30e0\",\"item\":\"https:\/\/dev.activebasic.com\/egtra\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"GDI+ (3) \u7dda\u3092\u5f15\u304f\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dev.activebasic.com\/egtra\/#website\",\"url\":\"https:\/\/dev.activebasic.com\/egtra\/\",\"name\":\"\u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d\",\"description\":\"\u982d\u306e\u4e2d\u306e\u304b\u3051\u3089\u3002ActiveBasic\u3092\u4e2d\u5fc3\u306b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u8a71\u3092\u307c\u3061\u307c\u3061\u3068\u3002\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dev.activebasic.com\/egtra\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/dev.activebasic.com\/egtra\/#\/schema\/person\/8de756b2ff20b964f64594dfe8f18164\",\"name\":\"egtra\",\"sameAs\":[\"https:\/\/x.com\/egtra\"],\"url\":\"https:\/\/dev.activebasic.com\/egtra\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"GDI+ (3) \u7dda\u3092\u5f15\u304f - \u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d","description":"\u524d\u56de\u4e88\u544a\u3057\u305f\u3068\u304a\u308a\u3001\u4eca\u65e5\u306fWin32\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8b1b\u5ea7 \uff5e Step32. \u30a2\u30ca\u30ed\u30b0\u6642\u8a08\u3092\u4f5c\u308b \uff5e\u3092GDI+\u3067\u66f8\u304f\u3068\u3069\u3046\u306a\u308b\u304b\u3068\u3044\u3046\u8a71\u3067\u3059\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/dev.activebasic.com\/egtra\/2006\/11\/30\/20\/","og_locale":"ja_JP","og_type":"article","og_title":"GDI+ (3) \u7dda\u3092\u5f15\u304f - \u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d","og_description":"\u524d\u56de\u4e88\u544a\u3057\u305f\u3068\u304a\u308a\u3001\u4eca\u65e5\u306fWin32\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8b1b\u5ea7 \uff5e Step32. \u30a2\u30ca\u30ed\u30b0\u6642\u8a08\u3092\u4f5c\u308b \uff5e\u3092GDI+\u3067\u66f8\u304f\u3068\u3069\u3046\u306a\u308b\u304b\u3068\u3044\u3046\u8a71\u3067\u3059\u3002","og_url":"https:\/\/dev.activebasic.com\/egtra\/2006\/11\/30\/20\/","og_site_name":"\u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d","article_publisher":"https:\/\/www.facebook.com\/ysk.noh","article_published_time":"2006-11-30T13:08:37+00:00","article_modified_time":"2011-05-11T17:17:17+00:00","author":"egtra","twitter_card":"summary_large_image","twitter_creator":"@egtra","twitter_site":"@egtra","twitter_misc":{"\u57f7\u7b46\u8005":"egtra","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"1\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/dev.activebasic.com\/egtra\/2006\/11\/30\/20\/","url":"https:\/\/dev.activebasic.com\/egtra\/2006\/11\/30\/20\/","name":"GDI+ (3) \u7dda\u3092\u5f15\u304f - \u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d","isPartOf":{"@id":"https:\/\/dev.activebasic.com\/egtra\/#website"},"datePublished":"2006-11-30T13:08:37+00:00","dateModified":"2011-05-11T17:17:17+00:00","author":{"@id":"https:\/\/dev.activebasic.com\/egtra\/#\/schema\/person\/8de756b2ff20b964f64594dfe8f18164"},"description":"\u524d\u56de\u4e88\u544a\u3057\u305f\u3068\u304a\u308a\u3001\u4eca\u65e5\u306fWin32\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8b1b\u5ea7 \uff5e Step32. \u30a2\u30ca\u30ed\u30b0\u6642\u8a08\u3092\u4f5c\u308b \uff5e\u3092GDI+\u3067\u66f8\u304f\u3068\u3069\u3046\u306a\u308b\u304b\u3068\u3044\u3046\u8a71\u3067\u3059\u3002","breadcrumb":{"@id":"https:\/\/dev.activebasic.com\/egtra\/2006\/11\/30\/20\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dev.activebasic.com\/egtra\/2006\/11\/30\/20\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/dev.activebasic.com\/egtra\/2006\/11\/30\/20\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/dev.activebasic.com\/egtra\/"},{"@type":"ListItem","position":2,"name":"GDI+ (3) \u7dda\u3092\u5f15\u304f"}]},{"@type":"WebSite","@id":"https:\/\/dev.activebasic.com\/egtra\/#website","url":"https:\/\/dev.activebasic.com\/egtra\/","name":"\u30a4\u30b0\u30c8\u30e9\u30f3\u30b9\u306e\u982d\u306e\u4e2d","description":"\u982d\u306e\u4e2d\u306e\u304b\u3051\u3089\u3002ActiveBasic\u3092\u4e2d\u5fc3\u306b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u8a71\u3092\u307c\u3061\u307c\u3061\u3068\u3002","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dev.activebasic.com\/egtra\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/dev.activebasic.com\/egtra\/#\/schema\/person\/8de756b2ff20b964f64594dfe8f18164","name":"egtra","sameAs":["https:\/\/x.com\/egtra"],"url":"https:\/\/dev.activebasic.com\/egtra\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/posts\/20"}],"collection":[{"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":0,"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/posts\/20\/revisions"}],"wp:attachment":[{"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/media?parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/categories?post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.activebasic.com\/egtra\/wp-json\/wp\/v2\/tags?post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}