( Index )
Month

Brief Information about the July 2001 CSIG Meeting

Viewer for BMP Files --- Windows API

3rd Tuesday of the month. 7:30PM - C/C++ Group, SPRS

Program Icon

Welcome to the C++ Users Group. This group is a "Special Interest Group" of the ACGNJ devoted to discussing programming languages in general and C, C++, and C++ for Windows programming in particular. Each month a small but hopefully useful program (complete with source code) is presented for discussion.

Bitmap processing will be demonstrated with an Print Screen program called "ViewBMP".

Microsoft Visual C++ and MFC have an unbelievably large number of functions related to graphical programming. This month we will consider bitmaps.

This month's program allows the viewing of bitmap files which are a popular form of picture file used on computers.

Simply drag and drop bitmap files from Windows Explorer and they will appear on the view screen. You may select all the files from a directory and drop them on the program. The program will only display the .BMP files.

If you drop more than one file, the program will present a slide show. The speed of presentation may be adjusted from the menu in the upper left corner. Use the space bar to pause the slide show. The right and left arrows determine the direction, forward or back.

At the meeting on Tuesday night we will be discussing the utility and the source code.


SAMPLE CODE
===========
void CVBDlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
	{
	// TODO: Add your message handler code here and/or call default
	CString rString;
	if (nChar == VK_SPACE) 
		switch (state)
			{
			case NORMAL:	state = PAUSE_DOWN;
							KillTimer(timerID);
							rString = csFiles[currentFile] + " ...WAITING...";
							SetWindowText(rString);
							break;
			case PAUSE_UP:	state = GETSET; break;
			}
	
	CDialog::OnKeyDown(nChar, nRepCnt, nFlags);
	}


void CVBDlg::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) 
	{
	if (nChar == VK_SPACE)
		switch (state)
			{
			case PAUSE_DOWN: state = PAUSE_UP; break;
			case GETSET:	state = NORMAL;
							SetWindowText(csFiles[currentFile]);
							timerID = SetTimer(1, 100, NULL); // Start timer.
							break;
			}
	else if (nChar == VK_LEFT)
		{
		forward = false;
		}
	else if (nChar == VK_RIGHT)
		{
		forward = true;
		}
	
	CDialog::OnKeyUp(nChar, nRepCnt, nFlags);
	}


"Random Access" questions start at 7:30 Tuesday night.

SOURCE CODE

Source Code Files

For help, email me at b a r n o l d @ i e e e . o r g
Back to C++ Main Page