{"id":237,"date":"2021-02-01T21:04:23","date_gmt":"2021-02-01T13:04:23","guid":{"rendered":"http:\/\/liyanliang.net\/?p=237"},"modified":"2021-02-01T21:10:23","modified_gmt":"2021-02-01T13:10:23","slug":"rgb%e7%9a%84cstring%e6%a0%bc%e5%bc%8f%e8%bd%ac%e6%8d%a2%e4%b8%bacolorref","status":"publish","type":"post","link":"http:\/\/liyanliang.net\/index.php\/2021\/02\/01\/rgb%e7%9a%84cstring%e6%a0%bc%e5%bc%8f%e8%bd%ac%e6%8d%a2%e4%b8%bacolorref\/","title":{"rendered":"RGB\u7684CString\u683c\u5f0f\u8f6c\u6362\u4e3aCOLORREF"},"content":{"rendered":"\n<p>\u73b0\u6709RGB\uff1astatic COLORREF clrAuto = RGB(255, 255, 255);<\/p>\n\n\n\n<p class=\"has-cyan-bluish-gray-background-color has-background\">&lt;1&gt;COLORREF\u683c\u5f0f\u7684RGB\u8f6c\u6362\u4e3aCString\u683c\u5f0f\uff1a_T(\"%d, %d, %d\")<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">static CString FormatColor(COLORREF color)\n{\n    CString str;\n    str.Format(_T(\"%d, %d, %d\"), GetRValue(color), GetGValue(color), GetBValue(color));\n\u200b\n    return str;\n}<\/pre>\n\n\n\n<p class=\"has-cyan-bluish-gray-background-color has-background\">&lt;2&gt;\u5c06RGB\u7684CString\u683c\u5f0f\u8f6c\u6362\u4e3aCOLORREF<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">static COLORREF GetColorRGB(const CString&amp; strColorText)\n{\n    COLORREF color;\n    char chR[6] = \"\", chG[6] = \"\", chB[6] = \"\";\n    std::string str = CStringA(strColorText);\n    const char* chColor = str.c_str();\n    scanf(chColor, \"%[^,],%[^,],%[^,]\", chR, chG, chB);\n    color = RGB(atoi(chR), atoi(chG), atoi(chB));\n    return color;\n}\n\u200b<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u73b0\u6709RGB\uff1astatic COLORREF clrAuto = RGB(255, 255, 255); &lt;1&gt;COLORREF\u683c\u5f0f\u7684RGB\u8f6c\u6362\u4e3aCString\u683c\u5f0f\uff1a_T(&#8220;%d, %d, %d&#8221;) &lt;2&gt;\u5c06RGB\u7684CString\u683c\u5f0f\u8f6c\u6362\u4e3aCOLORREF<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[26],"class_list":["post-237","post","type-post","status-publish","format-standard","hentry","category-c","tag-c"],"_links":{"self":[{"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/posts\/237","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/comments?post=237"}],"version-history":[{"count":2,"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/posts\/237\/revisions"}],"predecessor-version":[{"id":239,"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/posts\/237\/revisions\/239"}],"wp:attachment":[{"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/media?parent=237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/categories?post=237"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/liyanliang.net\/index.php\/wp-json\/wp\/v2\/tags?post=237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}