0

I love graphics programming through C & C++, I have worked a lot, but i am still very far away from bmp files, Can any one tell me how i can access bmp file through C, C++.
Thanks in advance :rolleyes:

4
Contributors
3
Replies
7
Views
12 Years
Discussion Span
Last Post by dalaharp
Featured Replies
  • 1

    If you just want to view images, there is a simple C code snippet on DaniWeb: [url]http://www.daniweb.com/code/snippet86.html[/url] It's called "Displaying a JPEG image using Windows GUI", it will also display BMP and other images. Read More

0

one easy way to do it is,

declare image and header array;

unsigned char Header[0x435],image[256][256];

and to read image;

fread(Header,1,0x435,fp);	// copy image header to Header array
		fseek(fp,0x436,SEEK_SET);	// Move file pointer to start of image data
		fread(image,1,256*256,fp);	// read image data and copy to ImageIn1[][] array

		fclose(fp);
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.