<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : How to make the Markup background transparent?</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : How to make the Markup background transparent?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 21 Apr 2026 00:35:07 +0000</pubDate>
  <lastBuildDate>Wed, 22 Dec 2010 10:22:25 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=12770</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[How to make the Markup background transparent? : thanks, but this still requires...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12770&amp;PID=61951&amp;title=how-to-make-the-markup-background-transparent#61951</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3171">evoX</a><br /><strong>Subject:</strong> 12770<br /><strong>Posted:</strong> 22 December 2010 at 10:22am<br /><br />thanks, but this still requires handling the CtlColor brush...]]>
   </description>
   <pubDate>Wed, 22 Dec 2010 10:22:25 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12770&amp;PID=61951&amp;title=how-to-make-the-markup-background-transparent#61951</guid>
  </item> 
  <item>
   <title><![CDATA[How to make the Markup background transparent? : Hi. Another way is create other...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12770&amp;PID=61944&amp;title=how-to-make-the-markup-background-transparent#61944</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4605">zitz</a><br /><strong>Subject:</strong> 12770<br /><strong>Posted:</strong> 22 December 2010 at 5:54am<br /><br />Hi.<br><span id="result_" ="short_text" lang="en"><span title="Нажмите, чтобы увидеть альтернативный перевод" ="hps">Another</span> <span title="Нажмите, чтобы увидеть альтернативный перевод" ="hps">way</span></span> is create other BufferDC - CBufferDCTransparent:<br><table width="99%"><tr><td><pre class="BBcode"><br>void CMarkupStatic::OnPaint()<br>{<br>&nbsp;&nbsp;&nbsp; if ( m_pUIElement == NULL )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CStatic::OnPaint();<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; class CBufferDCTransparent : public CDC<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CBufferDCTransparent( CPaintDC&amp; paintDC, BOOL bTransparent )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_bTransparent = bTransparent;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_hDestDC = paintDC.GetSafeHdc();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_rect = paintDC.m_ps.rcPaint;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Attach (::CreateCompatibleDC( m_hDestDC ) );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ( m_hDC != NULL )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_bitmap.Attach( ::CreateCompatibleBitmap( m_hDestDC,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; max( 1, m_rect.right ),<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; max( 1, m_rect.bottom ) ) );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_hOldBitmap = ::SelectObject( m_hDC, m_bitmap );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CRgn rgn;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rgn.CreateRectRgnIndirect( &amp;m_rect );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SelectClipRgn( &amp;rgn );<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ( m_bTransparent == TRUE )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; FillSolidRect( m_rect, (COLORREF)-1 );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; virtual ~CBufferDCTransparent()<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ( m_hDC != NULL )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ( m_hDestDC != NULL )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;<b>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ( m_bTransparent == TRUE )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ::TransparentBlt( m_hDestDC,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbs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p;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ::SelectObject( m_hDC, m_hOldBitmap );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; protected:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; HDC&nbsp;&nbsp;&nbsp;&nbsp; m_hDestDC;&nbsp;&nbsp;&nbsp; // Handle to the destination device context.<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CBitmap m_bitmap;&nbsp;&nbsp;&nbsp;&nbsp; // Bitmap in memory device context<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CRect&nbsp;&nbsp; m_rect;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Size of the area to paint.<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; HGDIOBJ m_hOldBitmap; // Handle to the previously selected bitmap.<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; BOOL&nbsp;&nbsp;&nbsp; m_bTransparent;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; };<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <b>BOOL bTransparent = ( GetExStyle() &amp; WS_EX_TRANSPARENT ) != 0;</b><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CPaintDC dcPaint( this );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <b>CBufferDCTransparent dcBuffer( dcPaint, bTransparent );</b><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CXTPClientRect rc( this );<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ( m_clrBackground == COLORREF_NULL )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ( bTransparent == FALSE )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; HBRUSH hBrush = NULL;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CWnd* pParent = GetParent();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ( pParent != NULL )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; hBrush = (HBRUSH)pParent-&gt;SendMessage( WM_CTLCOLORSTATIC,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp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sp;&nbsp; &nbsp;&nbsp;&nbsp; dcBuffer.FillSolidRect( rc, GetXtremeColor( COLOR_3DFACE ) );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dcBuffer.FillSolidRect( rc, m_clrBackground );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CXTPMarkupDrawingContext dc( dcBuffer );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CSize szAvailableSize = rc.Size();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_pUIElement-&gt;Measure( &amp;dc, szAvailableSize );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_pUIElement-&gt;Arrange( rc );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CRect rcClip = dc.GetClipBox();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Render( m_pUIElement, &amp;dc, rc.EqualRect( rcClip ) );<br>&nbsp;&nbsp;&nbsp; }<br>}<br></pre></td></tr></table><br>]]>
   </description>
   <pubDate>Wed, 22 Dec 2010 05:54:06 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12770&amp;PID=61944&amp;title=how-to-make-the-markup-background-transparent#61944</guid>
  </item> 
  <item>
   <title><![CDATA[How to make the Markup background transparent? : Horses for courses.... My version...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12770&amp;PID=50548&amp;title=how-to-make-the-markup-background-transparent#50548</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2426">robin_l</a><br /><strong>Subject:</strong> 12770<br /><strong>Posted:</strong> 01 July 2009 at 6:50pm<br /><br />Horses for courses.... My version of CMarkupStatic, which is only a handful of lines different from yours,&nbsp;still draws correctly if partially overlapped with other controls or if the background is not predefined by a bitmap. It also does not require each dialog box/view that uses it&nbsp;to define its own specific OnCtlColor handler. But your background brush method is neat as it handles the markup button controls as well as the markup static control.<DIV></DIV><DIV></DIV><DIV>&nbsp;</DIV><DIV>Either way, however, I still&nbsp;think it is a good idea to test for&nbsp;<FONT size=2>WS_EX_TRANSPARENT and only generate transparent backgrounds for controls that have this set <img src="http://forum.codejock.com/smileys/smiley1.gif" border="0"></DIV></FONT>]]>
   </description>
   <pubDate>Wed, 01 Jul 2009 18:50:27 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12770&amp;PID=50548&amp;title=how-to-make-the-markup-background-transparent#50548</guid>
  </item> 
  <item>
   <title><![CDATA[How to make the Markup background transparent? : Hi, See attached project. It...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12770&amp;PID=50532&amp;title=how-to-make-the-markup-background-transparent#50532</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 12770<br /><strong>Posted:</strong> 01 July 2009 at 8:05am<br /><br />Hi,<DIV>See attached project. It shows&nbsp; all.</DIV>]]>
   </description>
   <pubDate>Wed, 01 Jul 2009 08:05:40 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12770&amp;PID=50532&amp;title=how-to-make-the-markup-background-transparent#50532</guid>
  </item> 
  <item>
   <title><![CDATA[How to make the Markup background transparent? : I just had to deal with the same...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12770&amp;PID=50508&amp;title=how-to-make-the-markup-background-transparent#50508</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2426">robin_l</a><br /><strong>Subject:</strong> 12770<br /><strong>Posted:</strong> 30 June 2009 at 6:37pm<br /><br />I just had to deal with the same problem. My solution is to check to see whether the static control is Transparent or not (set from the resource editor in Visual Studio). If it is I BitBlt the underlying window background to form the backdrop for the control.<DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV><FONT color=#0000ff size=2><FONT color=#0000ff size=2><P>void</FONT></FONT><FONT size=2> CMarkupStatic::OnPaint() </P><P>{</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2> (!m_pUIElement)</P><P>{</P><P>CStatic::OnPaint();</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>return</FONT></FONT><FONT size=2>;</P><P>}</P><P>CPaintDC dcPaint(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>this</FONT></FONT><FONT size=2>);</P><P>CXTPBufferDC dcBuffer(dcPaint);</P><P>CXTPClientRect rc(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>this</FONT></FONT><FONT size=2>);</P><DIV>// check for transparency</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2></FONT></FONT></DIV><DIV><FONT color=#0000ff size=2><FONT color=#0000ff size=2>bool</FONT></FONT><FONT size=2> bTransparent = (GetExStyle() &amp; WS_EX_TRANSPARENT) ? </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>true</FONT></FONT><FONT size=2> : </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>false</FONT></FONT><FONT size=2>;</DIV><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2> (bTransparent)</P><P>{</P><P>CRect rect = rc;</P><P>ClientToScreen(&amp;rect);</P><P>GetParent()-&gt;ScreenToClient(&amp;rect);</P><P>CWindowDC dcWin(GetParent());</P><P>BitBlt(dcBuffer, rc.left, rc.top, rc.Width(), rc.Height(),</P><P>dcWin, rect.left,rect.top, SRCCOPY );</P><P>}</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>else</P></FONT></FONT><FONT size=2><P>{</P><P>HBRUSH hBrush = (HBRUSH)GetParent()-&gt;SendMessage(WM_CTLCOLORSTATIC, (WPARAM)dcBuffer.GetSafeHdc(), (LPARAM)m_hWnd);</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2> (hBrush)</P><P>{</P><P>::FillRect(dcBuffer.GetSafeHdc(), rc, hBrush);</P><P>}</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>else</P></FONT></FONT><FONT size=2><P>{</P><P>dcBuffer.FillSolidRect(rc, GetXtremeColor(COLOR_3DFACE));</P><P>}</P><P>}</P><DIV>// minor modification: don't draw if the window is disabled</DIV><DIV><P></P><P></P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2> (m_pUIElement &amp;&amp; IsWindowEnabled())</DIV><P>{</P><P>CXTPMarkupDrawingContext dc(dcBuffer);</P><P></P><P>m_pUIElement-&gt;Measure(&amp;dc, rc.Size());</P><P>m_pUIElement-&gt;Arrange(rc);</P><P>m_pUIElement-&gt;Render(&amp;dc);</P><P>}</P><P>}</P></FONT></DIV>]]>
   </description>
   <pubDate>Tue, 30 Jun 2009 18:37:09 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12770&amp;PID=50508&amp;title=how-to-make-the-markup-background-transparent#50508</guid>
  </item> 
  <item>
   <title><![CDATA[How to make the Markup background transparent? : Thanks Oleg ! Now it works, and...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12770&amp;PID=43346&amp;title=how-to-make-the-markup-background-transparent#43346</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3171">evoX</a><br /><strong>Subject:</strong> 12770<br /><strong>Posted:</strong> 02 December 2008 at 1:37am<br /><br />Thanks Oleg !<DIV>Now it works, and I got the point <img src="https://forum.codejock.com/smileys/smiley1.gif" border="0"></DIV>]]>
   </description>
   <pubDate>Tue, 02 Dec 2008 01:37:26 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12770&amp;PID=43346&amp;title=how-to-make-the-markup-background-transparent#43346</guid>
  </item> 
  <item>
   <title><![CDATA[How to make the Markup background transparent? :  Ok, here sample ms.zipHope its...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12770&amp;PID=43257&amp;title=how-to-make-the-markup-background-transparent#43257</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 12770<br /><strong>Posted:</strong> 27 November 2008 at 2:21pm<br /><br /><DIV>&nbsp;</DIV><DIV>Ok, here sample&nbsp; <a href="https://forum.codejock.com/uploads/20081127_142038_ms.zip" target="_blank">ms.zip</A>&nbsp;Hope its clear now :)</DIV>]]>
   </description>
   <pubDate>Thu, 27 Nov 2008 14:21:24 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12770&amp;PID=43257&amp;title=how-to-make-the-markup-background-transparent#43257</guid>
  </item> 
  <item>
   <title><![CDATA[How to make the Markup background transparent? : your CMarkupStatic is Child Window....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12770&amp;PID=43256&amp;title=how-to-make-the-markup-background-transparent#43256</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 12770<br /><strong>Posted:</strong> 27 November 2008 at 1:49pm<br /><br /><DIV>your CMarkupStatic is Child Window. All Markup elelemnt in this window is windowless elements they can be transparent - but your child window cant. </DIV><DIV>Child windows in Windows can't be trasparent , all standard controls use WM_CTLCOLOR message to draw part of parent dialog.</DIV>]]>
   </description>
   <pubDate>Thu, 27 Nov 2008 13:49:09 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12770&amp;PID=43256&amp;title=how-to-make-the-markup-background-transparent#43256</guid>
  </item> 
  <item>
   <title><![CDATA[How to make the Markup background transparent? : It&amp;#039;s very hard to calculate...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12770&amp;PID=43248&amp;title=how-to-make-the-markup-background-transparent#43248</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3171">evoX</a><br /><strong>Subject:</strong> 12770<br /><strong>Posted:</strong> 27 November 2008 at 6:34am<br /><br />It's very hard to calculate since the dialog pixels changes for small or large fonts... I think it would be better to read the bitmap behind the static, saved in a buffer then painted back.<DIV>&nbsp;</DIV><DIV>But I really don't understand how are the rest of the markup controls in the toolkit? they all don't support transparent background ? </DIV><DIV>...so if I use a simple markup which displays a text on a button with office 2007 theme then I will get a rectangle surrounding the text on the button? :(</DIV>]]>
   </description>
   <pubDate>Thu, 27 Nov 2008 06:34:43 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12770&amp;PID=43248&amp;title=how-to-make-the-markup-background-transparent#43248</guid>
  </item> 
  <item>
   <title><![CDATA[How to make the Markup background transparent? : Hi, That&amp;#039;s why I wrote you...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12770&amp;PID=43238&amp;title=how-to-make-the-markup-background-transparent#43238</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 12770<br /><strong>Posted:</strong> 27 November 2008 at 1:58am<br /><br /><P>Hi,</P><DIV>That's why I wrote you need Offset. Calculate rc using coordinates of Parent dialog.</DIV>]]>
   </description>
   <pubDate>Thu, 27 Nov 2008 01:58:07 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12770&amp;PID=43238&amp;title=how-to-make-the-markup-background-transparent#43238</guid>
  </item> 
 </channel>
</rss>