<?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[Bildposition berechnen]]></title><description><![CDATA[<p>Ich lade ein Bild und füge es über Gdi in ein Image ein. Ziel soll sein es mittig zu positionieren. Jedoch sind alle Bilder eine ganze Ecke nach rechts versetzt, was mir aber nicht einleuchtet. Hat jemand eine Idee, was falsch ist ?</p>
<pre><code>int iw = image.GetWidth(); // = 188
		int ih = image.GetHeight(); // = 487
		if (iw &lt; ImageZiel-&gt;Width) // ImageZiel-&gt;Width = 561
		{
			iXPos = ((ImageZiel-&gt;Width - iw) / 2); // iXPos = 186
		}
		Gdiplus::Rect destRect(iXPos, 0, iw, ih);
		graphics.DrawImage(&amp;image, destRect);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/200505/bildposition-berechnen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 18 Aug 2026 22:54:55 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/200505.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 15 Dec 2007 21:43:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bildposition berechnen on Sat, 15 Dec 2007 21:43:50 GMT]]></title><description><![CDATA[<p>Ich lade ein Bild und füge es über Gdi in ein Image ein. Ziel soll sein es mittig zu positionieren. Jedoch sind alle Bilder eine ganze Ecke nach rechts versetzt, was mir aber nicht einleuchtet. Hat jemand eine Idee, was falsch ist ?</p>
<pre><code>int iw = image.GetWidth(); // = 188
		int ih = image.GetHeight(); // = 487
		if (iw &lt; ImageZiel-&gt;Width) // ImageZiel-&gt;Width = 561
		{
			iXPos = ((ImageZiel-&gt;Width - iw) / 2); // iXPos = 186
		}
		Gdiplus::Rect destRect(iXPos, 0, iw, ih);
		graphics.DrawImage(&amp;image, destRect);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1421156</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1421156</guid><dc:creator><![CDATA[WernerI]]></dc:creator><pubDate>Sat, 15 Dec 2007 21:43:50 GMT</pubDate></item><item><title><![CDATA[Reply to Bildposition berechnen on Sat, 15 Dec 2007 23:57:51 GMT]]></title><description><![CDATA[<p>Das dürfte damt was zu tun haben</p>
<pre><code class="language-cpp">if (iw &lt; ImageZiel-&gt;Width) // ImageZiel-&gt;Width = 561 
        { 
            iXPos = ((ImageZiel-&gt;Width - iw) / 2); // iXPos = 186 
        }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1421197</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1421197</guid><dc:creator><![CDATA[einauge]]></dc:creator><pubDate>Sat, 15 Dec 2007 23:57:51 GMT</pubDate></item></channel></rss>