<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Visual C++ Tips &#187; GradientFill</title>
	<atom:link href="http://weseetips.com/tag/gradientfill/feed/" rel="self" type="application/rss+xml" />
	<link>http://weseetips.com</link>
	<description>Gold mine of Visual C++ tricks!</description>
	<lastBuildDate>Thu, 11 Mar 2010 09:09:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>How to fill gradients in your dialog like InstallShield?</title>
		<link>http://weseetips.com/2008/06/05/how-to-fill-gradients-in-your-dialog-like-installshield/</link>
		<comments>http://weseetips.com/2008/06/05/how-to-fill-gradients-in-your-dialog-like-installshield/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 18:22:11 +0000</pubDate>
		<dc:creator>Jijo Raj</dc:creator>
				<category><![CDATA[Codeproject]]></category>
		<category><![CDATA[GDI & GDI+]]></category>
		<category><![CDATA[gradient]]></category>
		<category><![CDATA[GradientFill]]></category>
		<category><![CDATA[InstallShield]]></category>
		<category><![CDATA[installShield background]]></category>
		<category><![CDATA[InstallShield background gradient]]></category>

		<guid isPermaLink="false">http://weseetips.wordpress.com/?p=157</guid>
		<description><![CDATA[Look at the dialog. What&#8217;s the first thing that come to your mind when you see this? Yes! I can read it &#8211; the InstallShield. Its so common to our eyes, since almost all application setups comes via InstallShield. People identify installshield with its nice blue gradient in its background window. So how can we [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-medium wp-image-11" src="http://weseetips.files.wordpress.com/2008/03/icon_description.jpg?w=166" alt="" width="166" height="32" /><br />
Look at the dialog. What&#8217;s the first thing that come to your mind when you see this?</p>
<p><a href="http://siteground205.com/~weseetip/wp-content/uploads/2008/06/installshielddemo.jpg"><img class="alignnone size-full wp-image-158" src="http://siteground205.com/~weseetip/wp-content/uploads/2008/06/installshielddemo.jpg" alt="" width="510" height="355" /></a></p>
<p>Yes! I can read it &#8211; <span style="color:#0000ff;">the InstallShield</span>. Its so common to our eyes, since almost all application setups comes via InstallShield. People identify installshield with its <span style="color:#0000ff;">nice blue gradient in its background window</span>. So how can we generate such nice gradient background like installShield does?</p>
<p><img class="alignnone size-medium wp-image-12" src="http://weseetips.files.wordpress.com/2008/03/icon_howcanidoit.jpg?w=220" alt="" width="220" height="32" /><br />
You can use the function &#8211; <span style="color:#0000ff;">GradientFill()</span>. See the code snippet to generate the InstallShield effect. Its self explanatory.</p>
<pre>// Get the Device context.
CPaintDC dc( this );

// Get the client co-ordinates.
CRect rect;
GetClientRect( &amp;rect );

// Two gradient points.
TRIVERTEX vert[2] = { 0 };

// Set the first vertex point at 0,0 and with blue color.
// Since the array is initialize with 0, all other
// members in struct are 0.
vert[ 0 ] .Blue   = 0xff00;

// Initialize second vertex at endcorner of
// window with black color.
vert[ 1 ] .x      = rect.Width();
vert[ 1 ] .y      = rect.Height();

// Gradient rectangle.
GRADIENT_RECT GradientRect = { 0 };
GradientRect.UpperLeft = 0;
GradientRect.LowerRight = 1;

// Now fill the gradient.
GradientFill( dc.GetSafeHdc(),
              vert, // Gradient vertices.
              2,    // No. of vertices.
              &amp;GradientRect, // Gradient array.
              1,    // No. of items in Gradient Array.
              GRADIENT_FILL_RECT_V ); // Vertical Fill.</pre>
<p><img class="alignnone size-medium wp-image-18" src="http://weseetips.files.wordpress.com/2008/03/icon_note.jpg?w=94" alt="" width="94" height="32" /><br />
Don&#8217;t forget to add <span style="color:#0000ff;">Msimg32.lib</span> to your project settings.</p>
<p><img class="alignnone size-medium wp-image-53" src="http://weseetips.files.wordpress.com/2008/03/intermediateseries.jpg?w=248" alt="" width="248" height="32" /><br />
Targeted Audience &#8211; Intermediate.</p>
]]></content:encoded>
			<wfw:commentRss>http://weseetips.com/2008/06/05/how-to-fill-gradients-in-your-dialog-like-installshield/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

