<?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[Farben in einander verschwimmen lassen, wie bewirkt man diesen Effekt?]]></title><description><![CDATA[<p>Hallo,<br />
Ich habe schon bei vielen Beispielanwendungen diese Effekte gesehen und finde es sichtlich atrkativer als nur eine Farbe in einem Rechteck odr Kreis oder was auch immer, meist ja als Hintergrund.</p>
<p>Ich weiß aber leider nicht wie dieser Effekt heisst... koenntet ihr mir ein paar Stichwörter oder sogar Tuts geben?</p>
<p>Gruß Tobi.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/199458/farben-in-einander-verschwimmen-lassen-wie-bewirkt-man-diesen-effekt</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 21:58:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/199458.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 03 Dec 2007 12:09:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Farben in einander verschwimmen lassen, wie bewirkt man diesen Effekt? on Mon, 03 Dec 2007 12:09:39 GMT]]></title><description><![CDATA[<p>Hallo,<br />
Ich habe schon bei vielen Beispielanwendungen diese Effekte gesehen und finde es sichtlich atrkativer als nur eine Farbe in einem Rechteck odr Kreis oder was auch immer, meist ja als Hintergrund.</p>
<p>Ich weiß aber leider nicht wie dieser Effekt heisst... koenntet ihr mir ein paar Stichwörter oder sogar Tuts geben?</p>
<p>Gruß Tobi.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1414156</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1414156</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Mon, 03 Dec 2007 12:09:39 GMT</pubDate></item><item><title><![CDATA[Reply to Farben in einander verschwimmen lassen, wie bewirkt man diesen Effekt? on Mon, 03 Dec 2007 12:17:38 GMT]]></title><description><![CDATA[<p>Ich bin zwar kein Grafikexperte, aber versuch's mal mit &quot;Farbverlauf&quot; (wobei die Chancen gut stehen, daß du das selber programmieren mußt)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1414162</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1414162</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 03 Dec 2007 12:17:38 GMT</pubDate></item><item><title><![CDATA[Reply to Farben in einander verschwimmen lassen, wie bewirkt man diesen Effekt? on Mon, 03 Dec 2007 12:19:29 GMT]]></title><description><![CDATA[<p>-.- ...<br />
Und wie nennt man das, wenn ich des speziel in der GDI suche? muss doch irgendwo mal nen Artikel dazu geben.</p>
<p>Gruß Tobi.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1414166</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1414166</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Mon, 03 Dec 2007 12:19:29 GMT</pubDate></item><item><title><![CDATA[Reply to Farben in einander verschwimmen lassen, wie bewirkt man diesen Effekt? on Mon, 03 Dec 2007 12:36:53 GMT]]></title><description><![CDATA[<p>guck mal nach &quot;Gradient&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1414181</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1414181</guid><dc:creator><![CDATA[DrakoXP]]></dc:creator><pubDate>Mon, 03 Dec 2007 12:36:53 GMT</pubDate></item><item><title><![CDATA[Reply to Farben in einander verschwimmen lassen, wie bewirkt man diesen Effekt? on Mon, 03 Dec 2007 13:00:45 GMT]]></title><description><![CDATA[<p>hab ich shcon aba find irgendwie nichts für C++ also so nen paar schnippsel.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1414202</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1414202</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Mon, 03 Dec 2007 13:00:45 GMT</pubDate></item><item><title><![CDATA[Reply to Farben in einander verschwimmen lassen, wie bewirkt man diesen Effekt? on Mon, 03 Dec 2007 15:54:25 GMT]]></title><description><![CDATA[<p>guckst du hier:</p>
<p><a href="http://msdn2.microsoft.com/en-us/library/ms532348.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/ms532348.aspx</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1414321</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1414321</guid><dc:creator><![CDATA[DrakoXP]]></dc:creator><pubDate>Mon, 03 Dec 2007 15:54:25 GMT</pubDate></item><item><title><![CDATA[Reply to Farben in einander verschwimmen lassen, wie bewirkt man diesen Effekt? on Mon, 03 Dec 2007 20:11:57 GMT]]></title><description><![CDATA[<p>falls dir der Link immer noch nicht reicht, hier ein Beispiel (mit MSVC):</p>
<pre><code class="language-cpp">#pragma comment(lib, &quot;msimg32.lib&quot;)

#include &lt;windows.h&gt;

LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch (msg)
	{
	case WM_CLOSE:
		{
			DestroyWindow(hWnd);
			return 0;
		} break;
	case WM_DESTROY:
		{
			PostQuitMessage(0);
			return 0;
		} break;
	case WM_PAINT:
		{
			RECT client;
			GetClientRect(hWnd, &amp;client);
			client.bottom -= client.top;
			client.right -= client.left;
			TRIVERTEX        vert [4] ;
			GRADIENT_TRIANGLE    gTri[2];
			vert [0] .x       =  0;
			vert [0] .y       =  0;
			vert [0] .Red     =  0x0000;
			vert [0] .Green   =  0x0000;
			vert [0] .Blue    =  0xFF00;
			vert [0] .Alpha   =  0x0000;

			vert [1] .x       =  client.right;
			vert [1] .y       =  0;
			vert [1] .Red     =  0x7F80;
			vert [1] .Green   =  0x7F80;
			vert [1] .Blue    =  0xFF00;
			vert [1] .Alpha   =  0x0000;

			vert [2] .x       =  client.right;
			vert [2] .y       =  client.bottom; 
			vert [2] .Red     =  0xFF00;
			vert [2] .Green   =  0xFF00;
			vert [2] .Blue    =  0xFF00;
			vert [2] .Alpha   =  0x0000;

			vert [3] .x       =  0;
			vert [3] .y       =  client.bottom;
			vert [3] .Red     =  0x7F80;
			vert [3] .Green   =  0x7F80;
			vert [3] .Blue    =  0xFF00;
			vert [3] .Alpha   =  0x0000;

			gTri[0].Vertex1   = 0;
			gTri[0].Vertex2   = 1;
			gTri[0].Vertex3   = 2;

			gTri[1].Vertex1   = 0;
			gTri[1].Vertex2   = 2;
			gTri[1].Vertex3   = 3;

			PAINTSTRUCT ps;
			HDC hDC = BeginPaint(hWnd, &amp;ps);
			GradientFill(hDC, vert, 4, gTri, 2, GRADIENT_FILL_TRIANGLE);
			EndPaint(hWnd, &amp;ps);
			return 0;
		} break;
	}
	return DefWindowProc(hWnd, msg, wParam, lParam);
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLine, int iCmdShow)
{
	WNDCLASS wc;
	wc.cbClsExtra = 0;
	wc.cbWndExtra = 0;
	wc.hbrBackground = reinterpret_cast&lt;HBRUSH&gt;(GetStockObject(WHITE_BRUSH));
	wc.hCursor = LoadCursor(NULL, IDC_ARROW);
	wc.hIcon = LoadIcon(NULL, IDI_WINLOGO);
	wc.hInstance = hInstance;
	wc.lpfnWndProc = WndProc;
	wc.lpszClassName = L&quot;Gradient Window&quot;;
	wc.lpszMenuName = NULL;
	wc.style = CS_HREDRAW|CS_VREDRAW;
	RegisterClass(&amp;wc);
	HWND hWnd = CreateWindowEx(0, L&quot;Gradient Window&quot;, L&quot;Gradient&quot;, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
	if (!hWnd)
		return -1;
	ShowWindow(hWnd, SW_SHOW);
	MSG msg;
	while (GetMessage(&amp;msg, NULL, 0, 0))
	{
		TranslateMessage(&amp;msg);
		DispatchMessage(&amp;msg);
	}
	return static_cast&lt;int&gt;(msg.wParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1414450</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1414450</guid><dc:creator><![CDATA[DrakoXP]]></dc:creator><pubDate>Mon, 03 Dec 2007 20:11:57 GMT</pubDate></item><item><title><![CDATA[Reply to Farben in einander verschwimmen lassen, wie bewirkt man diesen Effekt? on Tue, 04 Dec 2007 05:04:18 GMT]]></title><description><![CDATA[<p>wenn du es flackerfrei haben willst, solltest du dir das mal anschauen:</p>
<pre><code class="language-cpp">#pragma comment(lib, &quot;msimg32.lib&quot;)

#include &lt;windows.h&gt;

BOOL CALLBACK ChildEnumProc(HWND hWnd, LPARAM lParam)
{
	InvalidateRect(hWnd, NULL, TRUE);
	return TRUE;
}

HDC BeginScene(HWND hWnd, HBITMAP* pBitmap)
{
	RECT r = { 0 };
	GetClientRect(hWnd, &amp;r);
	r.right -= r.left;
	r.bottom -= r.top;
	HDC hWindowDC = GetDC(hWnd);
	HDC hDoubleBufferDC = CreateCompatibleDC(hWindowDC);
	*pBitmap = CreateCompatibleBitmap(hWindowDC, r.right, r.bottom);
	SelectObject(hDoubleBufferDC, (*pBitmap));
	ReleaseDC(hWnd, hWindowDC);
	wchar_t szClassName[1024];
	GetClassName(hWnd, szClassName, 1024);
	WNDCLASSEX wce = { 0 };
	GetClassInfoEx(GetModuleHandle(NULL), szClassName, &amp;wce);
	FillRect(hDoubleBufferDC, &amp;r, wce.hbrBackground);
	return hDoubleBufferDC;
}

void EndScene(HWND hWnd, HDC hDoubleBufferDC, HBITMAP hBitmap)
{
	RECT r = { 0 };
	GetUpdateRect(hWnd, &amp;r, FALSE);
	if ((r.bottom == 0) &amp;&amp; (r.left == 0) &amp;&amp; (r.right == 0) &amp;&amp; (r.top == 0))
		GetClientRect(hWnd, &amp;r);
	PAINTSTRUCT ps = { 0 };
	HDC hWindowDC = BeginPaint(hWnd, &amp;ps);
	StretchBlt(hWindowDC, r.left, r.top, r.right, r.bottom, hDoubleBufferDC, r.left, r.top, r.right, r.bottom, SRCCOPY);
	EndPaint(hWnd, &amp;ps);
	DeleteObject(hBitmap);
	DeleteDC(hDoubleBufferDC);
	ValidateRect(hWnd, &amp;r);
	EnumChildWindows(hWnd, ChildEnumProc, 0);
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch (msg)
	{
	case WM_CLOSE:
		{
			DestroyWindow(hWnd);
			return 0;
		} break;
	case WM_DESTROY:
		{
			PostQuitMessage(0);
			return 0;
		} break;
	case WM_ERASEBKGND:
		{
			return 1;
		} break;
	case WM_PAINT:
		{
			RECT client;
			GetClientRect(hWnd, &amp;client);
			client.bottom -= client.top;
			client.right -= client.left;
			TRIVERTEX        vert [4] ;
			GRADIENT_TRIANGLE    gTri[2];
			vert [0] .x       =  0;
			vert [0] .y       =  0;
			vert [0] .Red     =  0x0000;
			vert [0] .Green   =  0x0000;
			vert [0] .Blue    =  0xFF00;
			vert [0] .Alpha   =  0x0000;

			vert [1] .x       =  client.right;
			vert [1] .y       =  0;
			vert [1] .Red     =  0x7F80;
			vert [1] .Green   =  0x7F80;
			vert [1] .Blue    =  0xFF00;
			vert [1] .Alpha   =  0x0000;

			vert [2] .x       =  client.right;
			vert [2] .y       =  client.bottom; 
			vert [2] .Red     =  0xFF00;
			vert [2] .Green   =  0xFF00;
			vert [2] .Blue    =  0xFF00;
			vert [2] .Alpha   =  0x0000;

			vert [3] .x       =  0;
			vert [3] .y       =  client.bottom;
			vert [3] .Red     =  0x7F80;
			vert [3] .Green   =  0x7F80;
			vert [3] .Blue    =  0xFF00;
			vert [3] .Alpha   =  0x0000;

			gTri[0].Vertex1   = 0;
			gTri[0].Vertex2   = 1;
			gTri[0].Vertex3   = 2;

			gTri[1].Vertex1   = 0;
			gTri[1].Vertex2   = 2;
			gTri[1].Vertex3   = 3;

			HBITMAP hBmp;
			HDC hDC = BeginScene(hWnd, &amp;hBmp);
			GradientFill(hDC, vert, 4, gTri, 2, GRADIENT_FILL_TRIANGLE);
			EndScene(hWnd, hDC, hBmp);
			return 0;
		} break;
	}
	return DefWindowProc(hWnd, msg, wParam, lParam);
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLine, int iCmdShow)
{
	WNDCLASS wc;
	wc.cbClsExtra = 0;
	wc.cbWndExtra = 0;
	wc.hbrBackground = reinterpret_cast&lt;HBRUSH&gt;(GetStockObject(WHITE_BRUSH));
	wc.hCursor = LoadCursor(NULL, IDC_ARROW);
	wc.hIcon = LoadIcon(NULL, IDI_WINLOGO);
	wc.hInstance = hInstance;
	wc.lpfnWndProc = WndProc;
	wc.lpszClassName = L&quot;Gradient Window&quot;;
	wc.lpszMenuName = NULL;
	wc.style = CS_HREDRAW|CS_VREDRAW;
	RegisterClass(&amp;wc);
	HWND hWnd = CreateWindowEx(0, L&quot;Gradient Window&quot;, L&quot;Gradient&quot;, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
	if (!hWnd)
		return -1;
	ShowWindow(hWnd, SW_SHOW);
	MSG msg;
	while (GetMessage(&amp;msg, NULL, 0, 0))
	{
		TranslateMessage(&amp;msg);
		DispatchMessage(&amp;msg);
	}
	return static_cast&lt;int&gt;(msg.wParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1414535</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1414535</guid><dc:creator><![CDATA[DrakoXP]]></dc:creator><pubDate>Tue, 04 Dec 2007 05:04:18 GMT</pubDate></item></channel></rss>