<?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[DIB korrekt zeichnen]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich habe eine DIBSection erstellt und möchte nun das resultierende HBITMAP mit BitBlt zeichnen. DIBs werden ja komplett Spiegelverkehrt dargestellt (d.h. die KO (0,0) sind im rechten, unteren Eck), BitBlt verwendet aber das normale Computerkoordinatensystem. Wie kann ich das DIB korrekt zeichnen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/128465/dib-korrekt-zeichnen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Jul 2026 23:52:56 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/128465.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 03 Dec 2005 21:03:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to DIB korrekt zeichnen on Sat, 03 Dec 2005 21:03:56 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich habe eine DIBSection erstellt und möchte nun das resultierende HBITMAP mit BitBlt zeichnen. DIBs werden ja komplett Spiegelverkehrt dargestellt (d.h. die KO (0,0) sind im rechten, unteren Eck), BitBlt verwendet aber das normale Computerkoordinatensystem. Wie kann ich das DIB korrekt zeichnen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/933476</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/933476</guid><dc:creator><![CDATA[tommazzo]]></dc:creator><pubDate>Sat, 03 Dec 2005 21:03:56 GMT</pubDate></item><item><title><![CDATA[Reply to DIB korrekt zeichnen on Sat, 03 Dec 2005 21:09:54 GMT]]></title><description><![CDATA[<p>Wenn Du das DIB ja schon &quot;darstellst&quot; dann brauchst Du es ja nicht nochmals zu zeichenen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Und wenn Du das DIB spiegelverkehrt erzeugst, darfst Du Dich natürlich nicht wundern, dass es auch so mit BitBlt angezeigt wird...</p>
<p>Aber mal ganz im ernst: wie kommst Du denn darauf, dass (0,0) unten rechts sein soll?</p>
<p>GetDIBits schrieb:</p>
<blockquote>
<p>The origin for a bottom-up DIB is the lower-left corner of the bitmap; the origin for a top-down DIB is the upper-left corner.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/933481</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/933481</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Sat, 03 Dec 2005 21:09:54 GMT</pubDate></item><item><title><![CDATA[Reply to DIB korrekt zeichnen on Sat, 03 Dec 2005 21:29:53 GMT]]></title><description><![CDATA[<p>Ooops, da habe ich mich wohl ein wenig geirrt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /> . Stimmt, (0, 0) ist in der unteren, linken Ecke.</p>
<p>Wieso muss ich das DIB neu zeichnen?<br />
Nun, das ganze ist wiederrum Teil meiner, dir wohl schon bekannten Reihe &quot;Wie komme ich um GDI+ herum?&quot; <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> . Ich bin damit soweit fertig, das einzige Problem besteht noch darin das Bild korrekt auf den Bildschirm zu bekommen. Ich erstelle das DIB folgendermaßen:<br />
1. CreateDIBSection()<br />
2. Ich rufe die LockBits() Methode in einem GDI+ Bitmap auf<br />
3. Ich kopiere die Bits</p>
<p>Leider ist das DIB Top-Down wenn ich es vom GDI+ Bitmap kopiere. Deswegen brauche ich auch entweder einen Weg, wie ich es korrekt auf den Bildschirm zeichne oder eine Möglichkeit die Bits im Kopiervorgang schon richtig anzuordnen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/933504</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/933504</guid><dc:creator><![CDATA[tommazzo]]></dc:creator><pubDate>Sat, 03 Dec 2005 21:29:53 GMT</pubDate></item><item><title><![CDATA[Reply to DIB korrekt zeichnen on Sat, 03 Dec 2005 22:53:50 GMT]]></title><description><![CDATA[<p>Ich denke ich hab' jetzt die Lösung:</p>
<pre><code class="language-csharp">private void CopyMemoryReversed(byte* dest, byte* src, uint length) {
    src += length;
    for (int y = 0; y &lt; height; ++y) {
        src -= rowStride;
        for (int x = 0; x &lt; width; ++x) {
            for (int i = 0; i &lt; bytesPerPixel; ++i)
                dest[i] = src[i];
            dest += bytesPerPixel;
            src += bytesPerPixel;
        }
        src -= rowStride;
    }
}
</code></pre>
<p>Anstelle die Bits mit einer WinAPI Funktion zu kopieren, kopiere ich sie selbst und ordne sie dabei richtig an.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/933587</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/933587</guid><dc:creator><![CDATA[tommazzo]]></dc:creator><pubDate>Sat, 03 Dec 2005 22:53:50 GMT</pubDate></item></channel></rss>