<?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[HDC Ausschnitt als jpg speichern]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich möchte gerne ein HDC unter GDI als jpg mit GDI+ speichern. Der Code aktuell:</p>
<pre><code>HDC hdc2; 
    HBITMAP aBmp;
    Gdiplus::Bitmap* gdippbitmap;
    HPALETTE pal=0;

    hdc2=CreateCompatibleDC(device-&gt;device); 
    aBmp=CreateCompatibleBitmap(device-&gt;device,rect-&gt;right,rect-&gt;bottom);
    SelectObject(hdc2,aBmp);

    BitBlt(hdc2,rect-&gt;left,rect-&gt;top,rect-&gt;right-rect-&gt;left,rect-&gt;bottom-rect-&gt;top,device-&gt;device,rect-&gt;left,rect-&gt;top,SRCCOPY);

    gdippbitmap=Gdiplus::Bitmap::FromHBITMAP(aBmp,0);

    DeleteObject(aBmp);
    DeleteDC(hdc2);
    delete gdippbitmap;
</code></pre>
<p>Jetzt habe ich zwar ein GDI+ Bitmap aber kein Image. Denn man kann nur ein Image speichern: <a href="http://msdn.microsoft.com/en-us/library/ms535407(VS.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms535407(VS.85).aspx</a></p>
<p>Irgendjemand ne Idee?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/216054/hdc-ausschnitt-als-jpg-speichern</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 09:09:25 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/216054.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 18 Jun 2008 15:32:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to HDC Ausschnitt als jpg speichern on Wed, 18 Jun 2008 15:32:03 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich möchte gerne ein HDC unter GDI als jpg mit GDI+ speichern. Der Code aktuell:</p>
<pre><code>HDC hdc2; 
    HBITMAP aBmp;
    Gdiplus::Bitmap* gdippbitmap;
    HPALETTE pal=0;

    hdc2=CreateCompatibleDC(device-&gt;device); 
    aBmp=CreateCompatibleBitmap(device-&gt;device,rect-&gt;right,rect-&gt;bottom);
    SelectObject(hdc2,aBmp);

    BitBlt(hdc2,rect-&gt;left,rect-&gt;top,rect-&gt;right-rect-&gt;left,rect-&gt;bottom-rect-&gt;top,device-&gt;device,rect-&gt;left,rect-&gt;top,SRCCOPY);

    gdippbitmap=Gdiplus::Bitmap::FromHBITMAP(aBmp,0);

    DeleteObject(aBmp);
    DeleteDC(hdc2);
    delete gdippbitmap;
</code></pre>
<p>Jetzt habe ich zwar ein GDI+ Bitmap aber kein Image. Denn man kann nur ein Image speichern: <a href="http://msdn.microsoft.com/en-us/library/ms535407(VS.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms535407(VS.85).aspx</a></p>
<p>Irgendjemand ne Idee?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1531692</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1531692</guid><dc:creator><![CDATA[Zauberspiegel]]></dc:creator><pubDate>Wed, 18 Jun 2008 15:32:03 GMT</pubDate></item><item><title><![CDATA[Reply to HDC Ausschnitt als jpg speichern on Thu, 19 Jun 2008 08:41:15 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>MSDN-Doku schrieb:</p>
<blockquote>
<p>The Bitmap class inherits from the Image class</p>
</blockquote>
<p>D.h., man sollte die <em>Save</em>-Methoden der <em>Image</em>-Klasse aufrufen können, auch mit einem <em>Gdiplus::Bitmap</em>-Objekt.</p>
<p>Allerdings steht dort auch:</p>
<p>MSDN-Doku schrieb:</p>
<blockquote>
<p>Do not pass to the FromHBITMAP method a GDI bitmap or a GDI palette that is currently (<strong>or was previously</strong>) selected into a device context.</p>
</blockquote>
<p>Einfach ausprobieren, was passiert, wenn die Bitmap korrekt aus dem DC entfernt wurde.</p>
<p>MfG,</p>
<p>Probe-Nutzer</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1532055</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1532055</guid><dc:creator><![CDATA[Probe-Nutzer]]></dc:creator><pubDate>Thu, 19 Jun 2008 08:41:15 GMT</pubDate></item><item><title><![CDATA[Reply to HDC Ausschnitt als jpg speichern on Sat, 27 Sep 2008 08:10:54 GMT]]></title><description><![CDATA[<p>hallo!</p>
<p>benutz doch einfach die CImage class</p>
<p>wenn du nach BitBlt und SelectObject eine HMBITMAP hast kannst du einfach</p>
<p>CImage::Attach(hBitmap);<br />
CImage::Save(ScreenName,ImageFormatJPEG);</p>
<p>benutzen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1588892</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1588892</guid><dc:creator><![CDATA[MaxGru]]></dc:creator><pubDate>Sat, 27 Sep 2008 08:10:54 GMT</pubDate></item></channel></rss>