?
Solved

How to Open a BITMAP Image using 'C' Language

Posted on 2003-03-31
4
Medium Priority
?
421 Views
Last Modified: 2008-03-06
hello friends

i have a very urgent problem,

i need to open a bit map image using C...

though i cnat give much point,s i wnat it vrey abadly

plz help ,me

gopal..
0
Comment
Question by:gopalleela
  • 2
3 Comments
 

Expert Comment

by:Getch
ID: 8239184
in 16bit environment? unpossible, define the compiler please.
0
 

Accepted Solution

by:
Getch earned 150 total points
ID: 8239213
you can only open it but you can view it in 16bit[unix,dos] a simple algorithm.

#include <stdio.h>

int main(int argc,char *argv[])
{
    FILE *input_bitmap_file;
    char ch;  
 
    if (argc != 2) {
       fprintf(stderr,"usage: %s bitmap[file]",argv[0]);
       exit(-1) /* exit with an error code */
    }
    if ( (input_bitmap_file = fopen(argv[1],"rb"))==NULL)
{
    fprintf(stderr,"Unable to open %s .\n",argv[2]);
   exit(-1) /* exit with an error code */
}

    while ((ch = getc(input_bitmap_file)) != EOF) {
    ... // YOUR ACTIONS,EVENTS
    }
}

this will open the file as a binary file
0
 
LVL 20

Expert Comment

by:jmcg
ID: 10187271
Nothing has happened on this question in more than 9 months. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
accept answer by Getch [grade B] (very unclear that this is what asker wanted).

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question