{"id":1384,"date":"2024-08-12T08:00:00","date_gmt":"2024-08-12T00:00:00","guid":{"rendered":"http:\/\/www.wyrcad.com\/?p=1384"},"modified":"2024-09-12T11:18:23","modified_gmt":"2024-09-12T03:18:23","slug":"%e5%9b%be%e7%89%87%e8%bf%87%e6%bb%a4%e6%9f%90%e7%a7%8d%e9%a2%9c%e8%89%b2","status":"publish","type":"post","link":"https:\/\/www.wyrcad.com\/?p=1384","title":{"rendered":"\u56fe\u7247\u989c\u8272\u5c4f\u853d"},"content":{"rendered":"\n<p>Option Explicit<br>Private Declare Function TransparentBlt Lib &#8220;msimg32&#8221; _<br>(ByVal hdcDest As Long, ByVal nXOriginDest As Long, _<br>ByVal nYOriginDest As Long, ByVal nWidthDest As Long, _<br>ByVal nHeightDest As Long, ByVal hdcSrc As Long, _<br>ByVal nXOriginSrc As Long, ByVal nYOriginSrc As Long, _<br>ByVal nWidthSrc As Long, ByVal nHeightSrc As Long, _<br>ByVal crTransparent As Long) As Long<br>Private Declare Function GetPixel Lib &#8220;gdi32&#8221; (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long<\/p>\n\n\n\n<p>&#8216;\u8c03\u7528\u793a\u4f8b<br>&#8216;\u6dfb\u52a0\u4e00\u4e2a PictureBox,\u547d\u540d\u4e3a picSource,\u5e76\u52a0\u8f7d\u56fe\u7247<br>Dim TransparentColor As Long<br>TransparentColor = GetPixel(picSource.hdc, 0, 0) &#8216;\u9009\u62e9\u5de6\u4e0a\u89d2(0,0)\u7684\u989c\u8272\u4e3a\u5c4f\u853d\u8272<br>&#8216;thne simply draw with the transparent color equal to the value we found above<br>With picSource<br>TransparentBlt Me.hdc, 0, 0, .ScaleWidth, .ScaleHeight, .hdc, 0, 0, .ScaleWidth, .ScaleHeight, TransparentColor<br>End With<br>Me.Refresh<\/p>\n\n\n\n<p>&#8216;\u5de6\u56fe\u5c4f\u853d(\u7eff\u8272)\u540e\u663e\u793a\u4e3a\u53f3\u56fe\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"687\" height=\"206\" src=\"https:\/\/www.wyrcad.com\/wp-content\/uploads\/2024\/08\/TransClr.jpg\" alt=\"\" class=\"wp-image-1570\" srcset=\"https:\/\/www.wyrcad.com\/wp-content\/uploads\/2024\/08\/TransClr.jpg 687w, https:\/\/www.wyrcad.com\/wp-content\/uploads\/2024\/08\/TransClr-300x90.jpg 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Option ExplicitPrivate Declare Function TransparentBlt  &hellip; <a href=\"https:\/\/www.wyrcad.com\/?p=1384\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c\u56fe\u7247\u989c\u8272\u5c4f\u853d\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[24,17],"class_list":["post-1384","post","type-post","status-publish","format-standard","hentry","category-bianchengyuandi","tag-vb","tag-biancheng"],"_links":{"self":[{"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/posts\/1384","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1384"}],"version-history":[{"count":10,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/posts\/1384\/revisions"}],"predecessor-version":[{"id":1825,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/posts\/1384\/revisions\/1825"}],"wp:attachment":[{"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1384"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1384"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1384"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}