<?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 : Transparent CXTButton?</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : Transparent CXTButton?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 22 Apr 2026 01:26:44 +0000</pubDate>
  <lastBuildDate>Mon, 20 Apr 2009 16:05:43 +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=13975</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[Transparent CXTButton? : Icon or bitmap (HBITMAP)? I have...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13975&amp;PID=48170&amp;title=transparent-cxtbutton#48170</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 13975<br /><strong>Posted:</strong> 20 April 2009 at 4:05pm<br /><br />Icon or bitmap (HBITMAP)? I have a button subclassed from CXTButton that loads an HBITMAP from a resource file. f you have an HBITMAP, you can do the following:<DIV>&nbsp;</DIV><FONT size=2><P>BITMAP bm = {0};</P><DIV>::GetObject( m_hbmImage, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>sizeof</FONT></FONT><FONT size=2>(bm), &amp;bm );</DIV><P></P><P>CBitmap bmpIcon;</P><P>bmpIcon.Attach(m_hbmImage);</FONT><FONT size=2></P><P>CSize iconSize(bm.bmWidth, bm.bmHeight);</P><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// convert the bitmap to a transparent icon.</P></FONT></FONT><FONT size=2><P>HICON hIcon = CXTPTransparentBitmap(bmpIcon).ConvertToIcon();</P><P>CXTPImageManagerIconHandle hIconHandle; </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// do not set equal to hIcon here or it will NOT destrory the icon</P></FONT></FONT><FONT size=2><P></P><P>hIconHandle = hIcon; </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// Will call DestoyIcon;</P></FONT></FONT><FONT size=2><P>SetIcon(iconSize, hIconHandle, CXTPImageManagerIconHandle(), FALSE);</P><P>m_hbmImage = NULL; </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// consumed and then deleted by bmpIcon in the CBitmap dtor that runs when this block of code goes out of scope.</P><DIV></DIV><P><FONT color=#000000>By default, pixel(0,0) is considered the background color that drives transparency. I once posted a question as to whether there was a way to specifically set the background color so the first pixel is not used and Oleg said there was. Unfortunately I don't recall what the member or method is but you can probably search the forum to find his answer (probably just find all my posts and his replies).</FONT></P><P><FONT color=#000000>If you actually have an icon, you should be able to use one of the SetIcon overloads (perhaps the one that takes in a CXTPImageManagerIcon, which has various member methods for loading your image). For instance I have some code that loads a bitmap from a file on disk and I do this:</P><DIV></DIV><FONT size=2><P>BOOL bAlphaBitmap = FALSE;</P><P>HBITMAP hbmMenuItem = CXTPImageManagerIcon::LoadBitmapFromFile( lpszImageFileName, &amp;bAlphaBitmap );</P></FONT></FONT></FONT></FONT>]]>
   </description>
   <pubDate>Mon, 20 Apr 2009 16:05:43 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13975&amp;PID=48170&amp;title=transparent-cxtbutton#48170</guid>
  </item> 
  <item>
   <title><![CDATA[Transparent CXTButton? : Hi, I am trying to create a CXTButton...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13975&amp;PID=47770&amp;title=transparent-cxtbutton#47770</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5140">yenjonat</a><br /><strong>Subject:</strong> 13975<br /><strong>Posted:</strong> 10 April 2009 at 1:25pm<br /><br />Hi, <br><br>I am trying to create a CXTButton that uses an icon with a transparent background.&nbsp; Is there an easy way to do this?&nbsp; I feel like there should be, but that I'm just missing something really simple.&nbsp; <br>]]>
   </description>
   <pubDate>Fri, 10 Apr 2009 13:25:09 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13975&amp;PID=47770&amp;title=transparent-cxtbutton#47770</guid>
  </item> 
 </channel>
</rss>