<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Icon extrahieren und speichern als Bitmap!]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich suche nach einer Möglichkeit um aus einer Exe-Datei ein Icon zu extrahieren.<br />
Dieses soll wenn möglich als Bitmap gepseichert werden?<br />
Vielen Dank!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/86189/icon-extrahieren-und-speichern-als-bitmap</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Jul 2026 14:38:18 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/86189.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 16 Sep 2004 20:18:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Icon extrahieren und speichern als Bitmap! on Thu, 16 Sep 2004 20:18:01 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich suche nach einer Möglichkeit um aus einer Exe-Datei ein Icon zu extrahieren.<br />
Dieses soll wenn möglich als Bitmap gepseichert werden?<br />
Vielen Dank!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/608651</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/608651</guid><dc:creator><![CDATA[Christoph99]]></dc:creator><pubDate>Thu, 16 Sep 2004 20:18:01 GMT</pubDate></item><item><title><![CDATA[Reply to Icon extrahieren und speichern als Bitmap! on Fri, 17 Sep 2004 04:58:14 GMT]]></title><description><![CDATA[<p>Vielleicht hilft dir das weiter:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------
//	Extrahiert das Icon einer Exe-Datei:
//
//	Parameter:
//
//		AnsiString exepath: Der Pfad der zu verwendenden Exe-Datei
//		int           size: 0 für 16*16 und 1 für 32*32
//		TBitmap       *bmp: Pointer auf Bitmap; (default == NULL)
//		TIcon         *ico: Pointer auf Icon; (default == NULL)
//
//	Rückgabewerte:
//
//		Erfolgreich = 0
//		Exe-Datei existert nicht = 1
//
//---------------------------------------------------------------------------
int __fastcall TFmExtractExeIcon::ExtractExeIcon( AnsiString exepath, int size, Graphics::TBitmap *bmp, Graphics::TIcon *ico )
{
   if( !FileExists(exepath) )
      return 1;

   TRect rect;
   bool newbmp = false;
   bool newico = false;

   if( bmp == NULL )
   {
   	bmp = new Graphics::TBitmap();
      newbmp = true;
   }
   if( ico == NULL )
   {
   	ico = new Graphics::TIcon();
      newico = true;
   }

   ico-&gt;Handle = ExtractIcon( 0, exepath.c_str(), 0 );

   if( size == 0 )
   {
		rect = Rect(0, 0, 16, 16);
      bmp-&gt;Width = 16;
      bmp-&gt;Height = 16;
   }
   else if( size == 1 )
   {
		rect = Rect(0, 0, 32, 32);
      bmp-&gt;Width = 32;
      bmp-&gt;Height = 32;
   }
   else
   {
		rect = Rect(0, 0, 16, 16);
      bmp-&gt;Width = 16;
      bmp-&gt;Height = 16;
   }
//   bmp-&gt;Height = ico-&gt;Height;
//   bmp-&gt;Width = ico-&gt;Width;
//   bmp-&gt;Canvas-&gt;Draw(0, 0, ico);
   bmp-&gt;Canvas-&gt;StretchDraw(rect, ico);
   ico-&gt;Height = 16;
   ico-&gt;Width  = 16;

   if( newbmp )
   	delete bmp;
   if( newico )
   	delete ico;

 	return 0;
}
//---------------------------------------------------------------------------
</code></pre>
<p>Keine Ahnung, wo das herkommt, lag bei mir auf der Platte...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/608742</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/608742</guid><dc:creator><![CDATA[Plemplem]]></dc:creator><pubDate>Fri, 17 Sep 2004 04:58:14 GMT</pubDate></item></channel></rss>