<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://mitov.com/wiki/skins/common/feed.css?301"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://mitov.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Method_function_IGDIPlus.TGPGraphics.GetHalftonePalette%28%29_%3A_HPALETTE</id>
		<title>Method function IGDIPlus.TGPGraphics.GetHalftonePalette() : HPALETTE - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://mitov.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Method_function_IGDIPlus.TGPGraphics.GetHalftonePalette%28%29_%3A_HPALETTE"/>
		<link rel="alternate" type="text/html" href="https://mitov.com/wiki/index.php?title=Method_function_IGDIPlus.TGPGraphics.GetHalftonePalette()_:_HPALETTE&amp;action=history"/>
		<updated>2026-06-12T09:20:22Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.17.0</generator>

	<entry>
		<id>https://mitov.com/wiki/index.php?title=Method_function_IGDIPlus.TGPGraphics.GetHalftonePalette()_:_HPALETTE&amp;diff=11127&amp;oldid=prev</id>
		<title>David Alm: Automated Syncronization with Documentation</title>
		<link rel="alternate" type="text/html" href="https://mitov.com/wiki/index.php?title=Method_function_IGDIPlus.TGPGraphics.GetHalftonePalette()_:_HPALETTE&amp;diff=11127&amp;oldid=prev"/>
				<updated>2012-10-18T17:18:32Z</updated>
		
		<summary type="html">&lt;p&gt;Automated Syncronization with Documentation&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;b&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
This is a Beta Read Only version of this page. &lt;br /&gt;
Please review and send recommendations to [mailto:mitov@mitov.com mitov@mitov.com]. &lt;br /&gt;
We will enable the editing as soon as we are happy with the overall Wiki site.&lt;br /&gt;
&amp;lt;/span&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Class:''' [[Class IGDIPlus.TGPGraphics|TGPGraphics]]&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
=== Delphi: ===&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
'''function''' GetHalftonePalette() : HPALETTE;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C++ Builder: ===&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
HPALETTE '''__fastcall''' GetHalftonePalette();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Visual C++ (MFC): ===&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
HPALETTE GetHalftonePalette();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
Returns a Windows halftone palette. &lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
Call this method to get a Windows halftone palette.&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;b&amp;gt;Example:&amp;lt;/b&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 The following example draws the same image twice. Before the&lt;br /&gt;
 image is drawn the second time, the code gets a halftone&lt;br /&gt;
 palette, selects the palette into a device context, and&lt;br /&gt;
 realizes the palette.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 var&lt;br /&gt;
   AGraphics1 : [[Interface IGDIPlus.IGPGraphics|IGPGraphics]];&lt;br /&gt;
   AGraphics2 : [[Interface IGDIPlus.IGPGraphics|IGPGraphics]];&lt;br /&gt;
   AImage     : [[Interface IGDIPlus.IGPImage|IGPImage]];&lt;br /&gt;
   APalette   : HPALETTE;&lt;br /&gt;
 &lt;br /&gt;
 begin&lt;br /&gt;
 &lt;br /&gt;
   AImage := [[Class IGDIPlus.TGPImage|TGPImage]].Create( 'Mosaic.png' );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code lang=&amp;quot;delphi&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   AGraphics1 := [[Class IGDIPlus.TGPGraphics|TGPGraphics]].Create( ACanvas );&lt;br /&gt;
   AGraphics1.[[Method function IGDIPlus.TGPGraphics.DrawImage(IGPImage;TGPPoint) : TGPGraphics|DrawImage]](AImage, 10, 10);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code lang=&amp;quot;delphi&amp;quot;&amp;gt;&lt;br /&gt;
   Araphics1 := NIL;&lt;br /&gt;
 &lt;br /&gt;
   APalette := [[Class IGDIPlus.TGPGraphics|TGPGraphics]].GetHalftonePalette();&lt;br /&gt;
   SelectPalette( ACanvas.Handle, APalette, FALSE);&lt;br /&gt;
   RealizePalette( ACanvas.Handle );&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
   AGraphics2 := [[Class IGDIPlus.TGPGraphics|TGPGraphics]].Create( ACanvas );&lt;br /&gt;
   graphics2.[[Method function IGDIPlus.TGPGraphics.DrawImage(IGPImage;TGPPoint) : TGPGraphics|DrawImage]](AImage, 300, 10);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &amp;lt;code lang=&amp;quot;delphi&amp;quot;&amp;gt;&lt;br /&gt;
   Araphics2 := NIL;&lt;br /&gt;
   DeleteObject( APalette);&lt;br /&gt;
 end;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Remarks&lt;br /&gt;
The purpose of the GetHalftonePalette method is to enable&lt;br /&gt;
GDI+ to produce a better quality halftone when the display&lt;br /&gt;
uses 8 bits per pixel. To display an image using the halftone&lt;br /&gt;
palette, use the following procedure:&lt;br /&gt;
&lt;br /&gt;
  1. Call GetHalftonePalette to get a GDI+ halftone palette.&lt;br /&gt;
  2. Select the halftone palette into a device context.&lt;br /&gt;
  3. Realize the palette by calling the RealizePalette&lt;br /&gt;
     function.&lt;br /&gt;
  4. Construct a Graphics object from a handle to the device&lt;br /&gt;
     context.&lt;br /&gt;
  5. Call the [[Method function IGDIPlus.TGPGraphics.DrawImage(IGPImage;TGPPoint) : TGPGraphics|DrawImage]] method of the Graphics object.&lt;br /&gt;
&lt;br /&gt;
Be sure to delete the palette when you have finished using&lt;br /&gt;
it. If you do not follow the preceding procedure, then on an&lt;br /&gt;
8-bits-per-pixel-display device, the default, 16-color&lt;br /&gt;
process is used, which results in a lesser quality halftone.&lt;/div&gt;</summary>
		<author><name>David Alm</name></author>	</entry>

	</feed>