Click here to Skip to main content
14,486,515 members

C / C++ / MFC

 
AnswerRe: How to make flowchart for matrix on C language? Pin
leon de boer19-Mar-20 15:09
Memberleon de boer19-Mar-20 15:09 
GeneralVC++ Error in Visual Studio 2017 After migration of application from VS2010 to VS2017 Professional Pin
Member 1326109416-Mar-20 20:35
MemberMember 1326109416-Mar-20 20:35 
AnswerRe: VC++ Error in Visual Studio 2017 After migration of application from VS2010 to VS2017 Professional Pin
OriginalGriff16-Mar-20 20:47
mveOriginalGriff16-Mar-20 20:47 
GeneralRe: VC++ Error in Visual Studio 2017 After migration of application from VS2010 to VS2017 Professional Pin
Richard MacCutchan17-Mar-20 2:15
mveRichard MacCutchan17-Mar-20 2:15 
GeneralRe: VC++ Error in Visual Studio 2017 After migration of application from VS2010 to VS2017 Professional Pin
leon de boer17-Mar-20 5:04
Memberleon de boer17-Mar-20 5:04 
Questionparsing bitmap files (2) Pin
fearless_14-Mar-20 21:53
Memberfearless_14-Mar-20 21:53 
AnswerRe: parsing bitmap files (2) Pin
Richard MacCutchan14-Mar-20 22:13
mveRichard MacCutchan14-Mar-20 22:13 
GeneralRe: parsing bitmap files (2) Pin
fearless_15-Mar-20 3:09
Memberfearless_15-Mar-20 3:09 
This is my write attempt.

BITMAPFILEHEADER BFH;
	BITMAPINFOHEADER BIH;
	RGBQUAD Palette;
	RGBQUAD  * Pixels = new RGBQUAD[10];

	cf.Read( &BFH, sizeof( BITMAPFILEHEADER ));
	cf.Read( &BIH, sizeof( BITMAPINFOHEADER ));

	for(int i =0; i<10; i++)
	{
		cf.Read(&Pixels[i],sizeof(RGBQUAD));
	
	}
	
	StringCchPrintfA(message,1024,"b0 is %d", Pixels[0].rgbBlue);
	MessageBox(NULL, message, "Textures.exe", MB_OK);
	StringCchPrintfA(message,1024,"g0 is %d", Pixels[0].rgbGreen);
	MessageBox(NULL, message, "Textures.exe", MB_OK);
	StringCchPrintfA(message,1024,"r0 is %d", Pixels[0].rgbRed);
	MessageBox(NULL, message, "Textures.exe", MB_OK);
	
	StringCchPrintfA(message,1024,"r1 is %d", Pixels[1].rgbRed);
	MessageBox(NULL, message, "Textures.exe", MB_OK);
	StringCchPrintfA(message,1024,"g1 is %d", Pixels[1].rgbGreen);
	MessageBox(NULL, message, "Textures.exe", MB_OK);
	StringCchPrintfA(message,1024,"b1 is %d", Pixels[1].rgbBlue);
	MessageBox(NULL, message, "Textures.exe", MB_OK);


	CFile fileWrite;

	Pixels[0].rgbBlue = 100;
	Pixels[0].rgbGreen = 100;
	Pixels[0].rgbRed = 50;
	// Attempt to create the file.
	if( !fileWrite.Open( pszFilename,
		CFile::modeCreate | CFile::modeWrite ) )
		return( FALSE );

	fileWrite.Write( &BFH, sizeof( BITMAPFILEHEADER ) );
	fileWrite.Write( &BIH, sizeof( BITMAPINFOHEADER ) );
	for(int i =0;i<10; i++)
	{
		fileWrite.Write( &Pixels[i], sizeof( RGBQUAD ) );
	}


when I start my program again I expect the values of the first pixel to be updated but they aren`t
GeneralRe: parsing bitmap files (2) Pin
Richard MacCutchan15-Mar-20 3:34
mveRichard MacCutchan15-Mar-20 3:34 
GeneralRe: parsing bitmap files (2) Pin
fearless_15-Mar-20 4:05
Memberfearless_15-Mar-20 4:05 
GeneralRe: parsing bitmap files (2) Pin
Richard MacCutchan15-Mar-20 4:24
mveRichard MacCutchan15-Mar-20 4:24 
GeneralRe: parsing bitmap files (2) Pin
fearless_15-Mar-20 7:02
Memberfearless_15-Mar-20 7:02 
GeneralRe: parsing bitmap files (2) Pin
Richard MacCutchan15-Mar-20 7:04
mveRichard MacCutchan15-Mar-20 7:04 
AnswerRe: parsing bitmap files (2) Pin
leon de boer15-Mar-20 0:25
Memberleon de boer15-Mar-20 0:25 
AnswerRe: parsing bitmap files (2) Pin
fearless_15-Mar-20 1:59
Memberfearless_15-Mar-20 1:59 
Questionc libraries needed to deal with bitmaps Pin
fearless_11-Mar-20 6:59
Memberfearless_11-Mar-20 6:59 
AnswerRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan11-Mar-20 7:44
mveRichard MacCutchan11-Mar-20 7:44 
GeneralRe: c libraries needed to deal with bitmaps Pin
fearless_11-Mar-20 9:49
Memberfearless_11-Mar-20 9:49 
GeneralRe: c libraries needed to deal with bitmaps Pin
fearless_11-Mar-20 21:51
Memberfearless_11-Mar-20 21:51 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan11-Mar-20 22:35
mveRichard MacCutchan11-Mar-20 22:35 
GeneralRe: c libraries needed to deal with bitmaps Pin
fearless_11-Mar-20 23:27
Memberfearless_11-Mar-20 23:27 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan11-Mar-20 23:36
mveRichard MacCutchan11-Mar-20 23:36 
GeneralRe: c libraries needed to deal with bitmaps Pin
fearless_12-Mar-20 0:18
Memberfearless_12-Mar-20 0:18 
GeneralRe: c libraries needed to deal with bitmaps Pin
Richard MacCutchan12-Mar-20 2:31
mveRichard MacCutchan12-Mar-20 2:31 
GeneralRe: c libraries needed to deal with bitmaps Pin
fearless_12-Mar-20 4:40
Memberfearless_12-Mar-20 4:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.