|
-
December 24th, 2006, 11:00 AM
#1
Simple bitmap program
Hello everyone, I have Visual C++ and basic understanding of programming. I enjoy tinkering with simple programs but often run into trouble getting them to work. Recently I have been trying to make a program to read from a bitmap file. What I actually want to do is use the pixel information from a bitmap image to create ASCII text art. I think I may be able to create the text output with what I already know, but I am unsure how to actually find the pixel values for the bits in a bitmap file. So far, all I have been able to do is load up the file with an input stream with something like this:
#include "stdafx.h"
#include <iostream>
#include <fstream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
ifstream is("myBitmap.bmp");
system("pause");
return 0;
}
I've tried using the cout command and some other commands that i'm not all that fammiliar with such as is.get() to try to find pixel values. However, so far i've only been able to get it to display the file address and some values that appear to be garbage. If anyone could provide me with some simple code to find bitmap pixel values I would appreciate it. Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|