?
Solved

How to Open a BITMAP Image using 'C' Language

Posted on 2003-03-31
4
Medium Priority
?
416 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
Suggested Courses
Course of the Month7 days, 23 hours left to enroll

765 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