<?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[Datei mit mehreren Bitmaps -&amp;gt; Ein Bitmap laden]]></title><description><![CDATA[<p>Hi,<br />
ich möchte ein eigenes Dateiformat erstellen in dem mehrere Bitmaps und noch andere Informationen gespeichert werden können. Leider habe ich Bitmaps bisher nur per LoadImage geladen und weiß nicht wie man Bitmaps sozusagen von Hand lädt. Es wäre also nett wenn mir jemand sagen könnte wie ich ein komplettes Bitmap(geräteunabhänig) aus einer Datei lade, also auch mit Kopfinformationen.<br />
Danke schon im voraus.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/123118/datei-mit-mehreren-bitmaps-gt-ein-bitmap-laden</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Jul 2026 14:29:46 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/123118.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 13 Oct 2005 08:39:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Datei mit mehreren Bitmaps -&amp;gt; Ein Bitmap laden on Thu, 13 Oct 2005 08:39:52 GMT]]></title><description><![CDATA[<p>Hi,<br />
ich möchte ein eigenes Dateiformat erstellen in dem mehrere Bitmaps und noch andere Informationen gespeichert werden können. Leider habe ich Bitmaps bisher nur per LoadImage geladen und weiß nicht wie man Bitmaps sozusagen von Hand lädt. Es wäre also nett wenn mir jemand sagen könnte wie ich ein komplettes Bitmap(geräteunabhänig) aus einer Datei lade, also auch mit Kopfinformationen.<br />
Danke schon im voraus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/891116</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/891116</guid><dc:creator><![CDATA[Gast_]]></dc:creator><pubDate>Thu, 13 Oct 2005 08:39:52 GMT</pubDate></item><item><title><![CDATA[Reply to Datei mit mehreren Bitmaps -&amp;gt; Ein Bitmap laden on Thu, 13 Oct 2005 09:25:27 GMT]]></title><description><![CDATA[<p>fileformat: <a href="http://www.wotsit.org/" rel="nofollow">http://www.wotsit.org/</a><br />
beispiele findest auf vielen spieleprogrammierseiten<br />
<a href="http://www.google.com/custom?hl=en&amp;lr=&amp;ie=ISO-8859-1&amp;oe=ISO-8859-1&amp;client=pub-3167291168602081&amp;cof=FORID%3A1%3BL%3Ahttp%3A%2F%2Fimages.gamedev.net%2Fsitelogo.gif%3BLH%3A50%3BLW%3A225%3BGL%3A1%3BBGC%3AFFFFFF%3BT%3A%23000000%3BLC%3A%233366cc%3BVLC%3A%233366cc%3BALC%3A%233366ff%3BGALT%3A%23339966%3BGFNT%3A%23808080%3BGIMP%3A%23008000%3BDIV%3A%233366CC%3BLBGC%3AFFFFFF%3BAH%3Acenter%3BS%3Ahttp%3A%2F%2Fwww.gamedev.net%3B&amp;domains=GameDev.net&amp;q=bitmap&amp;btnG=Search&amp;sitesearch=GameDev.net" rel="nofollow">http://www.google.com/custom?hl=en&amp;lr=&amp;ie=ISO-8859-1&amp;oe=ISO-8859-1&amp;client=pub-3167291168602081&amp;cof=FORID%3A1%3BL%3Ahttp%3A%2F%2Fimages.gamedev.net%2Fsitelogo.gif%3BLH%3A50%3BLW%3A225%3BGL%3A1%3BBGC%3AFFFFFF%3BT%3A%23000000%3BLC%3A%233366cc%3BVLC%3A%233366cc%3BALC%3A%233366ff%3BGALT%3A%23339966%3BGFNT%3A%23808080%3BGIMP%3A%23008000%3BDIV%3A%233366CC%3BLBGC%3AFFFFFF%3BAH%3Acenter%3BS%3Ahttp%3A%2F%2Fwww.gamedev.net%3B&amp;domains=GameDev.net&amp;q=bitmap&amp;btnG=Search&amp;sitesearch=GameDev.net</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/891162</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/891162</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Thu, 13 Oct 2005 09:25:27 GMT</pubDate></item><item><title><![CDATA[Reply to Datei mit mehreren Bitmaps -&amp;gt; Ein Bitmap laden on Thu, 13 Oct 2005 17:37:12 GMT]]></title><description><![CDATA[<p>Danke,<br />
ich hab mir die Links angeschaut. Beim Probieren bin ich nun aber leider an eine Stelle gekommen, an der ich nicht mehr weiter weiß. Ich poste mal den ganzen Code, er ist zwar ein bisschen flüchtig zusammengesetzt, dürfte aber nicht schwer zu verstehen sein.</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;cstdio&gt;

#define WINDOW_NAME &quot;Test&quot;
#define CLASS_NAME	&quot;MyWindowClass&quot;

HBITMAP		hBMP = NULL;

HRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);

HBITMAP LoadBitmap (char* szName);

int WINAPI WinMain (HINSTANCE hI, HINSTANCE hPI,
					LPSTR lpCmdLine, int iCmdShow)
{

	WNDCLASSEX wc;

	wc.cbClsExtra		= NULL;
	wc.cbSize			= sizeof( WNDCLASSEX );
	wc.cbWndExtra		= NULL;
	wc.hbrBackground	= (HBRUSH)GetStockObject( WHITE_BRUSH );
	wc.hCursor			= LoadCursor( 0, IDC_ARROW );
	wc.hIcon			= LoadIcon( 0, IDI_WINLOGO );
	wc.hIconSm			= NULL;
	wc.hInstance		= hI;
	wc.lpfnWndProc		= WndProc;
	wc.lpszClassName	= CLASS_NAME;
	wc.lpszMenuName		= NULL;
	wc.style			= CS_VREDRAW|CS_HREDRAW;

	RegisterClassEx( &amp;wc );

	HWND hWnd = CreateWindowEx( NULL, CLASS_NAME, WINDOW_NAME, WS_OVERLAPPEDWINDOW,
								CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
								NULL, NULL, hI, NULL );

	ShowWindow( hWnd, iCmdShow );
	UpdateWindow( hWnd );

	MSG msg;

	hBMP = LoadBitmap( &quot;Bitmap.bmp&quot; );
	InvalidateRect( hWnd, NULL, true );

	while (GetMessage( &amp;msg, NULL, 0, 0 ))
	{

		TranslateMessage( &amp;msg );
		DispatchMessage( &amp;msg );

	} // while

	UnregisterClass( CLASS_NAME, hI );

	DeleteObject( hBMP );

	return msg.wParam;

} // WinMain

HRESULT CALLBACK WndProc (HWND hWnd, UINT message,
						  WPARAM wParam, LPARAM lParam)
{

	PAINTSTRUCT ps;
	HDC			hDC = NULL;
	HDC			hBmpDC = NULL;

	switch (message)
	{
	case WM_DESTROY:
		{
			PostQuitMessage( 0 );

			return 0;
		} // case WM_DESTROY

	case WM_PAINT:
		{

			hDC = BeginPaint( hWnd, &amp;ps );

			hBmpDC = CreateCompatibleDC( hDC );
			SelectObject( hBmpDC, hBMP );
			BitBlt( hDC, 0, 0, 200, 200, hBmpDC, 0, 0, SRCCOPY );
			DeleteDC( hBmpDC );

			EndPaint( hWnd, &amp;ps );

			return 0;

		} // case WM_PAINT

	} // switch

	return DefWindowProc( hWnd, message, wParam, lParam );

} // WndProc

HBITMAP LoadBitmap (char* szName)
{

	/* Variablen zum Laden der Informationen */
	FILE*				pFile			= NULL;
	BITMAPFILEHEADER	bmfh;
	BITMAPINFOHEADER	bmih;
	RGBQUAD*			colors			= NULL;
	int					size			= 0;
	BYTE*				tempPixelData	= NULL;
	HBITMAP				hBmp			= NULL;

	/* Öffnen der Datei */
	pFile = fopen( szName, &quot;rb&quot; );

	/* Laden des Dateikopfs */
	fread( &amp;bmfh, sizeof( BITMAPFILEHEADER ), 1, pFile );

	/* Laden der Kopfinformationen */
	fread( &amp;bmih, sizeof( BITMAPINFOHEADER ), 1, pFile );

	/* Laden der Farbpalette */
	if (bmih.biBitCount &lt; 24)
	{

		size = 1 &lt;&lt; bmih.biBitCount;
		colors = new RGBQUAD[size];

		if (colors == NULL)
		{
			fclose( pFile );
			return 0;
		} // if

		fread( colors, sizeof( RGBQUAD ), size, pFile );

	} // if

	/* Laden der Pixeldaten */
	size = bmfh.bfSize - bmfh.bfOffBits;
	tempPixelData = new BYTE[size];
	fread( tempPixelData, sizeof( BYTE ), size, pFile );

	/* Schließen des Handles */
	fclose( pFile );

	/* Bitmap erstellen */
	hBmp = CreateBitmap( bmih.biWidth, bmih.biHeight,
						 bmih.biPlanes, bmih.biBitCount, tempPixelData );

	/* Speicherfreigabe */
	delete [] colors;
	delete [] tempPixelData;

	return hBmp;

} // LoadBitmap
</code></pre>
<p>Ich habe dieses Programm schon einmal mit der LoadImage Funktion getestet und es hat funktioniert. Wer weiß was hier falsch ist schreibe das bitte.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/891626</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/891626</guid><dc:creator><![CDATA[Gast_]]></dc:creator><pubDate>Thu, 13 Oct 2005 17:37:12 GMT</pubDate></item></channel></rss>