Exforsys
+ Reply to Thread
Results 1 to 3 of 3

Open images in C program

This is a discussion on Open images in C program within the C and C++ forums, part of the Programming Talk category; how to open jpeg image with the help of c.......

  1. #1
    Manyamanas is offline Member Array
    Join Date
    Dec 2010
    Answers
    32

    Open images in C program

    how to open jpeg image with the help of c....

    Last edited by admin; 03-28-2011 at 07:14 AM.

  2. #2
    swapwarick's Avatar
    swapwarick is offline Member Array
    Join Date
    Mar 2011
    Location
    Pune,India
    Answers
    37
    Code:
    include"file.h"
    include"stdio.h"
    
    main()
    { FILE *fp;
    char ch;
    fp=fopen("c:\tcpp\pic1.jpeg","rb+");
    
    if(fp == NULL)
    {
            printf("Error in opening the image");
            fclose(fp);
            exit(0);
    }
    
    printf("Successfully opened the image file");
    
    while((ch = fgetc(fp))!=EOF)
    {
            printf("%c",ch);
    }
    
    printf("\nWriting to o/p completed");
    
    } // may work
    this will open the jpeg in binary format!
    but if u can allow a viewport it maybe possible { i use my Intel Cpp compiler with directx 10 libs}
    it worked!! <<<ya i know directx 10 can do it>>> but try in C if u want.
    for more info bout jpeg file binary format log on to wikipedia and search jpeg file format.

    Last edited by admin; 03-28-2011 at 07:08 AM.

  3. #3
    Bernard is offline Junior Member Array
    Join Date
    Mar 2011
    Answers
    2
    Thanks for sharing this coding it is very helpful for me.


    •    Sponsored Ads



Latest Article

Network Security Risk Assessment and Measurement

Read More...