{"id":17123,"date":"2019-08-16T18:27:19","date_gmt":"2019-08-16T09:27:19","guid":{"rendered":"http:\/\/www.ricka.co.jp\/?p=17123"},"modified":"2019-08-16T18:27:19","modified_gmt":"2019-08-16T09:27:19","slug":"vc-monitor-size","status":"publish","type":"post","link":"https:\/\/ricka.co.jp\/?p=17123","title":{"rendered":"VC \u30e2\u30cb\u30bf\u30fc\u306e\u7269\u7406\u30b5\u30a4\u30ba(\u30a4\u30f3\u30c1)\u306e\u53d6\u5f97\u65b9\u6cd5"},"content":{"rendered":"<p>&nbsp;<\/p>\n<h2>\u306f\u3058\u3081\u306b<\/h2>\n<p>VC\u3067\u3001\u300c\u30e2\u30cb\u30bf\u30fc\u304c\u7269\u7406\u7684\u306b\u4f55\u30a4\u30f3\u30c1\u306a\u306e\u304b\uff1f\u300d\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3092\u66f8\u304d\u307e\u3059\u3002<\/p>\n<p>\u4e00\u767a\u3067\u3068\u308c\u308b\u308f\u3051\u3067\u306f\u306a\u304f\u3001\u8a08\u7b97\u3092\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u3067\u3059\u304c\u3001<br \/>\nGetDeviceCaps()\u3092\u4f7f\u7528\u3059\u308b\u306e\u3067\u3001\u5bfe\u8c61OS\u304cWindows 2000\u307e\u3067\u5e83\u304c\u308a\u307e\u3059\u3002<br \/>\nWindows 7\u304c\u30b5\u30dd\u30fc\u30c8\u5207\u308c\u308b\u3053\u306e\u3054\u6642\u4e16\u306b\u305d\u3053\u307e\u3067\u30ab\u30d0\u30fc\u3057\u306a\u304f\u3066\u3082\u3068\u3082\u601d\u3046\u3051\u3069\u3001<br \/>\n\u4f59\u8a08\u306a\u5b9f\u88c5\u3084\u4f9d\u5b58\u95a2\u4fc2\u3092\u8003\u3048\u306a\u304f\u3066\u3044\u3044\u306e\u304c\u3046\u308c\u3057\u3044\u3067\u3059\u306d\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1\u306fDC\u3092\u53d6\u5f97\u3057\u305f\u308a\u3059\u308b\u306e\u3067\u3001<br \/>\n\u3044\u3089\u3059\u3068\u3084\u3055\u3093\u304b\u3089\u30ef\u30b7\u30f3\u30c8\u30f3DC\u306e\u753b\u50cf\u3092&#8230;<\/p>\n<h2>\u30e2\u30cb\u30bf\u30fc\u30b5\u30a4\u30ba\u306e\u8a08\u7b97<\/h2>\n<p>\u4eca\u56de\u306f\u3001<span style=\"display: inline !important; float: none; background-color: transparent; color: #333333; cursor: text; font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;\">GetDeviceCaps()<\/span>\u3092\u4f7f\u7528\u3057\u3066\u3001\u7269\u7406\u30b9\u30af\u30ea\u30fc\u30f3\u306e\u5e45\u3068\u9ad8\u3055(\u30df\u30ea\u30e1\u30fc\u30c8\u30eb)\u3092\u53d6\u5f97\u3057\u3066\u8a08\u7b97\u3057\u307e\u3059\u3002<br \/>\n<span style=\"display: inline !important; float: none; background-color: transparent; color: #333333; cursor: text; font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;\">\u53d6\u5f97\u3067\u304d\u308b\u306e\u304c\u30df\u30ea\u30e1\u30fc\u30c8\u30eb\u306a\u306e\u3067\u3001\u30a4\u30f3\u30c1\u306b\u5358\u4f4d\u5909\u63db\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n1in = 25.4mm<\/span><\/p>\n<p>\u30e2\u30cb\u30bf\u30fc\u30b5\u30a4\u30ba\u3092\u7b97\u51fa\u3059\u308b\u5f0f\u3067\u3059\u3002<br \/>\n<span style=\"display: inline !important; float: none; background-color: transparent; color: #333333; cursor: text; font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;\">\u30e2\u30cb\u30bf\u30fc\u30b5\u30a4\u30ba(in) = sqrt(\u5e45 * \u5e45 + \u9ad8\u3055 * \u9ad8\u3055) \/ 25.4(mm)<\/span><\/p>\n<h2>\u305d\u306e\u4ed6<\/h2>\n<p>DC\u304c\u5fc5\u8981\u3068\u306a\u308b\u306e\u3067\u3001<span style=\"color: #222222; font-family: Consolas;\">GetDC(NULL)<\/span>\u3067\u753b\u9762\u5168\u4f53\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<br \/>\n\u3042\u3068\u3001\u53d6\u5f97\u3057\u305fDC\u306f\u30ea\u30ea\u30fc\u30b9\u304c\u5fc5\u8981\u306a\u306e\u3067\u4f7f\u7528\u5f8c\u306f\u3001<span style=\"color: #222222; font-family: Consolas;\">ReleaseDC<\/span>()\u3092\u3059\u308b\u3002<\/p>\n<p><span style=\"color: #222222; font-family: Consolas;\">GetDeviceCaps<\/span>()\u306eindex\u306b\u306f\u3001<br \/>\nHORZSIZE\u3000\uff1a\u3000Width, in millimeters, of the physical screen. (\u5e45)<br \/>\nVERTSIZE\u3000\uff1a\u3000Height, in millimeters, of the physical screen. (\u9ad8\u3055)<br \/>\n\u3092\u6307\u5b9a\u3059\u308b\u3002<\/p>\n<h2>\u30bd\u30fc\u30b9<\/h2>\n<p>\u7c21\u5358\u306b\u30b3\u30f3\u30bd\u30fc\u30eb\u30a2\u30d7\u30ea\u306e\u30b3\u30fc\u30c9\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002<\/p>\n<pre><code>#include &lt;iostream&gt;\n#include &lt;windows.h&gt;\nint main()\n{\n\tHDC hdc = GetDC(NULL);\n\tint iHORZSIZE = GetDeviceCaps(hdc, HORZSIZE);\n\tint iVERTSIZE = GetDeviceCaps(hdc, VERTSIZE);\n\tReleaseDC(NULL, hdc);\n\n\tstd::cout &lt;&lt;\n\t\t\" HORZSIZE:\" &lt;&lt; iHORZSIZE &lt;&lt; \"mm\" &lt;&lt; std::endl &lt;&lt;\n\t\t\" VERTSIZE:\" &lt;&lt; iVERTSIZE &lt;&lt; \"mm\" &lt;&lt; std::endl &lt;&lt;\n\t\t\" inch:\" &lt;&lt; sqrt(iHORZSIZE * iHORZSIZE + iVERTSIZE * iVERTSIZE) \/ 25.4 &lt;&lt; \"in\" &lt;&lt; std::endl &lt;&lt;\n\t\t\"\";\n\n\treturn 0;\n}<\/code><\/pre>\n<p>\u3053\u3053\u304b\u3089\u4e0b\u306f\u304a\u307e\u3051<\/p>\n<h2>\u89e3\u50cf\u5ea6\u3068DPI\u306e\u53d6\u5f97<\/h2>\n<p>\u5f53\u521d\u3001\u30a4\u30f3\u30c1\u8a08\u7b97\u306e\u305f\u3081\u306b\u3001\u89e3\u50cf\u5ea6\u3068DPI\u3092\u53d6\u5f97\u3057\u3066\u8a08\u7b97\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u307e\u3057\u305f\u3002<br \/>\n\u3057\u304b\u3057\u3001\u3069\u3046\u3057\u3066\u3082DPI\u304c\u6c7a\u3081\u6253\u3061\u3057\u304b\u8fd4\u3055\u306a\u3044\u306e\u3067\u8ae6\u3081\u307e\u3057\u305f\u3002<\/p>\n<p>Windows\u3067\u306fDPI\u306f\u4e92\u63db\u6027\u306e\u305f\u3081\u306b96\u3092\u5fc5\u305a\u8fd4\u3059\u305d\u3046\u3067\u3059\u3002<br \/>\n\u62e1\u5927\u7e2e\u5c0f\u3084\u30ab\u30b9\u30bf\u30e0\u30b9\u30b1\u30fc\u30ea\u30f3\u30b0\u3092\u884c\u3063\u3066\u3044\u308b\u3068\u300196\u306b\u500d\u7387\u3092\u304b\u3051\u305f\u6570\u5b57\u304c\u8fd4\u3063\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>Aware\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5\u3082\u8a66\u3057\u305f\u3093\u3067\u3059\u3051\u3069\u3060\u3081\u3067\u3057\u305f\u3002<\/p>\n<p>\u95a2\u4fc2\u306a\u3044\u3051\u3069GetWindowRect()\u3067\u89e3\u50cf\u5ea6\u3092\u53d6\u5f97\u3057\u305f\u308a\u3082\u3057\u305f\u306e\u3067\u3001<br \/>\n\u4e00\u5fdc\u3001\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3082\u306e\u305b\u3068\u304d\u307e\u3059\u3002<br \/>\n\u8272\u3093\u306a\u74b0\u5883\u3067\u8a66\u3059\u3068\u9762\u767d\u3044\u3067\u3059\u3088\uff01\uff01<\/p>\n<pre><code>#include &lt;iostream&gt;\n#include &lt;windows.h&gt;\nint main()\n{\n\tSetProcessDPIAware();\n\n\tRECT rc;\n\tGetWindowRect(GetDesktopWindow(), &amp;rc);\n\n\tstd::cout &lt;&lt;\n\t\t\" left:\" &lt;&lt; rc.left &lt;&lt; std::endl &lt;&lt;\n\t\t\" top:\" &lt;&lt; rc.top &lt;&lt; std::endl &lt;&lt;\n\t\t\" right:\" &lt;&lt; rc.right &lt;&lt; std::endl &lt;&lt;\n\t\t\" bottom:\" &lt;&lt; rc.bottom &lt;&lt; std::endl &lt;&lt;\n\t\t\"\";\n\n\tHDC hdc = GetDC(NULL);\n\tint iHORZRES = GetDeviceCaps(hdc, HORZRES);\n\tint iVERTRES = GetDeviceCaps(hdc, VERTRES);\n\tint iLOGPIXELSX = GetDeviceCaps(hdc, LOGPIXELSX);\n\tint iLOGPIXELSY = GetDeviceCaps(hdc, LOGPIXELSY);\n\n\tint iHORZSIZE = GetDeviceCaps(hdc, HORZSIZE);\n\tint iVERTSIZE = GetDeviceCaps(hdc, VERTSIZE);\n\n\tReleaseDC(NULL, hdc);\n\n\tstd::cout &lt;&lt;\n\t\t\" HORZRES:\" &lt;&lt; iHORZRES &lt;&lt; std::endl &lt;&lt;\n\t\t\" VERTRES:\" &lt;&lt; iVERTRES &lt;&lt; std::endl &lt;&lt;\n\t\t\" LOGPIXELSX:\" &lt;&lt; iLOGPIXELSX &lt;&lt; std::endl &lt;&lt;\n\t\t\" LOGPIXELSY:\" &lt;&lt; iLOGPIXELSY &lt;&lt; std::endl &lt;&lt;\n\t\t\"\";\n\n\tstd::cout &lt;&lt;\n\t\t\"inch:\" &lt;&lt; sqrt(iHORZRES * iHORZRES + iVERTRES * iVERTRES) \/ iLOGPIXELSX &lt;&lt; std::endl &lt;&lt;\n\t\t\"\";\n\n\tstd::cout &lt;&lt;\n\t\t\" HORZSIZE:\" &lt;&lt; iHORZSIZE &lt;&lt; std::endl &lt;&lt;\n\t\t\" VERTSIZE:\" &lt;&lt; iVERTSIZE &lt;&lt; std::endl &lt;&lt;\n\t\t\" inch:\" &lt;&lt; sqrt(iHORZSIZE * iHORZSIZE + iVERTSIZE * iVERTSIZE) \/ 25.4 &lt;&lt; std::endl &lt;&lt;\n\t\t\"\";\n\tint i;\n\tstd::cin &gt;&gt; i;\n\n\treturn 0;\n}<\/code><\/pre>\n<div class=\"veu_socialSet veu_socialSet-position-after veu_contentAddSection\"><script>window.twttr=(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src=\"https:\/\/platform.twitter.com\/widgets.js\";fjs.parentNode.insertBefore(js,fjs);t._e=[];t.ready=function(f){t._e.push(f);};return t;}(document,\"script\",\"twitter-wjs\"));<\/script><ul><li class=\"sb_facebook sb_icon\"><a href=\"\/\/www.facebook.com\/sharer.php?src=bm&u=https%3A%2F%2Fricka.co.jp%2F%3Fp%3D17123&amp;t=VC+%E3%83%A2%E3%83%8B%E3%82%BF%E3%83%BC%E3%81%AE%E7%89%A9%E7%90%86%E3%82%B5%E3%82%A4%E3%82%BA%28%E3%82%A4%E3%83%B3%E3%83%81%29%E3%81%AE%E5%8F%96%E5%BE%97%E6%96%B9%E6%B3%95+%7C+%E6%A0%AA%E5%BC%8F%E4%BC%9A%E7%A4%BE%E3%83%AA%E3%83%83%E3%82%AB\" target=\"_blank\" onclick=\"window.open(this.href,'FBwindow','width=650,height=450,menubar=no,toolbar=no,scrollbars=yes');return false;\"><span class=\"vk_icon_w_r_sns_fb icon_sns\"><\/span><span class=\"sns_txt\">Facebook<\/span><span class=\"veu_count_sns_fb\"><\/span><\/a><\/li><li class=\"sb_twitter sb_icon\"><a href=\"\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fricka.co.jp%2F%3Fp%3D17123&amp;text=VC+%E3%83%A2%E3%83%8B%E3%82%BF%E3%83%BC%E3%81%AE%E7%89%A9%E7%90%86%E3%82%B5%E3%82%A4%E3%82%BA%28%E3%82%A4%E3%83%B3%E3%83%81%29%E3%81%AE%E5%8F%96%E5%BE%97%E6%96%B9%E6%B3%95+%7C+%E6%A0%AA%E5%BC%8F%E4%BC%9A%E7%A4%BE%E3%83%AA%E3%83%83%E3%82%AB\" target=\"_blank\" ><span class=\"vk_icon_w_r_sns_twitter icon_sns\"><\/span><span class=\"sns_txt\">twitter<\/span><\/a><\/li><li class=\"sb_hatena sb_icon\"><a href=\"\/\/b.hatena.ne.jp\/add?mode=confirm&url=https%3A%2F%2Fricka.co.jp%2F%3Fp%3D17123&amp;title=VC+%E3%83%A2%E3%83%8B%E3%82%BF%E3%83%BC%E3%81%AE%E7%89%A9%E7%90%86%E3%82%B5%E3%82%A4%E3%82%BA%28%E3%82%A4%E3%83%B3%E3%83%81%29%E3%81%AE%E5%8F%96%E5%BE%97%E6%96%B9%E6%B3%95+%7C+%E6%A0%AA%E5%BC%8F%E4%BC%9A%E7%A4%BE%E3%83%AA%E3%83%83%E3%82%AB\" target=\"_blank\"  onclick=\"window.open(this.href,'Hatenawindow','width=650,height=450,menubar=no,toolbar=no,scrollbars=yes');return false;\"><span class=\"vk_icon_w_r_sns_hatena icon_sns\"><\/span><span class=\"sns_txt\">Hatena<\/span><span class=\"veu_count_sns_hb\"><\/span><\/a><\/li><li class=\"sb_pocket sb_icon\"><a href=\"\/\/getpocket.com\/edit?url=https%3A%2F%2Fricka.co.jp%2F%3Fp%3D17123&title=VC+%E3%83%A2%E3%83%8B%E3%82%BF%E3%83%BC%E3%81%AE%E7%89%A9%E7%90%86%E3%82%B5%E3%82%A4%E3%82%BA%28%E3%82%A4%E3%83%B3%E3%83%81%29%E3%81%AE%E5%8F%96%E5%BE%97%E6%96%B9%E6%B3%95+%7C+%E6%A0%AA%E5%BC%8F%E4%BC%9A%E7%A4%BE%E3%83%AA%E3%83%83%E3%82%AB\" target=\"_blank\"  onclick=\"window.open(this.href,'Pokcetwindow','width=650,height=450,menubar=no,toolbar=no,scrollbars=yes');return false;\"><span class=\"vk_icon_w_r_sns_pocket icon_sns\"><\/span><span class=\"sns_txt\">Pocket<\/span><span class=\"veu_count_sns_pocket\"><\/span><\/a><\/li><\/ul><\/div><!-- [ \/.socialSet ] -->","protected":false},"excerpt":{"rendered":"<p>&nbsp; \u306f\u3058\u3081\u306b VC\u3067\u3001\u300c\u30e2\u30cb\u30bf\u30fc\u304c\u7269\u7406\u7684\u306b\u4f55\u30a4\u30f3\u30c1\u306a\u306e\u304b\uff1f\u300d\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3092\u66f8\u304d\u307e\u3059\u3002 \u4e00\u767a\u3067\u3068\u308c\u308b\u308f\u3051\u3067\u306f\u306a\u304f\u3001\u8a08\u7b97\u3092\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u3067\u3059\u304c\u3001 GetDeviceCaps()\u3092\u4f7f\u7528\u3059\u308b\u306e\u3067\u3001\u5bfe\u8c61OS\u304cWin [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":17379,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,26,4],"tags":[],"class_list":["post-17123","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cpp","category-windows","category-blog"],"_links":{"self":[{"href":"https:\/\/ricka.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/17123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ricka.co.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ricka.co.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ricka.co.jp\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/ricka.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17123"}],"version-history":[{"count":0,"href":"https:\/\/ricka.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/17123\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ricka.co.jp\/index.php?rest_route=\/wp\/v2\/media\/17379"}],"wp:attachment":[{"href":"https:\/\/ricka.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ricka.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ricka.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}