Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Read JPEG file

Read JPEG file

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
8 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shakumar_22
    wrote on last edited by
    #1

    Hi I want to Read the JPEG file in the CFile or CStdioFile format. I used to Write and read ".doc",".xt" file format by CStdioFile file1; file1.m_pStream=fopen("d:/newfile1.doc","a+"); file1.WriteString(L"hai"); file1.Close(); now i want to Read and Write the JPEG formated file.Some of them said read file in Binary format, but i dont know how to read in binary format. Give your suggestion to Read and Writeing of jpeg file format regards shakumar

    shakumar

    S P N K D 5 Replies Last reply
    0
    • S shakumar_22

      Hi I want to Read the JPEG file in the CFile or CStdioFile format. I used to Write and read ".doc",".xt" file format by CStdioFile file1; file1.m_pStream=fopen("d:/newfile1.doc","a+"); file1.WriteString(L"hai"); file1.Close(); now i want to Read and Write the JPEG formated file.Some of them said read file in Binary format, but i dont know how to read in binary format. Give your suggestion to Read and Writeing of jpeg file format regards shakumar

      shakumar

      S Offline
      S Offline
      shivditya
      wrote on last edited by
      #2

      I think you must read stream fundamentals. fstream fs; fs.open("file.txt",ios::bin); // not sure about bin or binary. Search in C++ books, msdn does not have good documentation about streams.

      || ART OF LIVING ||

      1 Reply Last reply
      0
      • S shakumar_22

        Hi I want to Read the JPEG file in the CFile or CStdioFile format. I used to Write and read ".doc",".xt" file format by CStdioFile file1; file1.m_pStream=fopen("d:/newfile1.doc","a+"); file1.WriteString(L"hai"); file1.Close(); now i want to Read and Write the JPEG formated file.Some of them said read file in Binary format, but i dont know how to read in binary format. Give your suggestion to Read and Writeing of jpeg file format regards shakumar

        shakumar

        P Offline
        P Offline
        Paresh Chitte
        wrote on last edited by
        #3

        Please refer here[^]. Regards, Paresh.

        1 Reply Last reply
        0
        • S shakumar_22

          Hi I want to Read the JPEG file in the CFile or CStdioFile format. I used to Write and read ".doc",".xt" file format by CStdioFile file1; file1.m_pStream=fopen("d:/newfile1.doc","a+"); file1.WriteString(L"hai"); file1.Close(); now i want to Read and Write the JPEG formated file.Some of them said read file in Binary format, but i dont know how to read in binary format. Give your suggestion to Read and Writeing of jpeg file format regards shakumar

          shakumar

          N Offline
          N Offline
          Naveen
          wrote on last edited by
          #4

          shakumar_22 wrote:

          file1.m_pStream=fopen("d:/newfile1.doc","a+");

          Why use this? there is an open function for CStdioFile and CFile. file1.Open("d:/newfile1.doc",CFile::modeRead|CFile::modeWrite); There are some other flags also for opening. you can use the same for opening JPEG files. But what you gonne do by reading row JPEG data?

          nave [OpenedFileFinder]

          S 1 Reply Last reply
          0
          • S shakumar_22

            Hi I want to Read the JPEG file in the CFile or CStdioFile format. I used to Write and read ".doc",".xt" file format by CStdioFile file1; file1.m_pStream=fopen("d:/newfile1.doc","a+"); file1.WriteString(L"hai"); file1.Close(); now i want to Read and Write the JPEG formated file.Some of them said read file in Binary format, but i dont know how to read in binary format. Give your suggestion to Read and Writeing of jpeg file format regards shakumar

            shakumar

            K Offline
            K Offline
            KarstenK
            wrote on last edited by
            #5

            You havent understand and I guess read the documentation of the CStdioFile class. Read this first and do your homeworks at home.:mad:

            Greetings from Germany

            1 Reply Last reply
            0
            • N Naveen

              shakumar_22 wrote:

              file1.m_pStream=fopen("d:/newfile1.doc","a+");

              Why use this? there is an open function for CStdioFile and CFile. file1.Open("d:/newfile1.doc",CFile::modeRead|CFile::modeWrite); There are some other flags also for opening. you can use the same for opening JPEG files. But what you gonne do by reading row JPEG data?

              nave [OpenedFileFinder]

              S Offline
              S Offline
              shakumar_22
              wrote on last edited by
              #6

              I want to send JPEG file through socket and write there in the receiving system as JPEG file. for that purpose only i reading the jpeg file. if any other way also suggest me to transfer the JPEG FILE through Socket from one system to onther

              shakumar

              N 1 Reply Last reply
              0
              • S shakumar_22

                I want to send JPEG file through socket and write there in the receiving system as JPEG file. for that purpose only i reading the jpeg file. if any other way also suggest me to transfer the JPEG FILE through Socket from one system to onther

                shakumar

                N Offline
                N Offline
                Naveen
                wrote on last edited by
                #7

                shakumar_22 wrote:

                if any other way also suggest me to transfer the JPEG FILE through Socket from one system to onther

                :) Your idea is not bad. you dont have to do any special handling for transfering JPEG file. Follow the same steps you followed for doc and other files.

                nave [OpenedFileFinder]

                1 Reply Last reply
                0
                • S shakumar_22

                  Hi I want to Read the JPEG file in the CFile or CStdioFile format. I used to Write and read ".doc",".xt" file format by CStdioFile file1; file1.m_pStream=fopen("d:/newfile1.doc","a+"); file1.WriteString(L"hai"); file1.Close(); now i want to Read and Write the JPEG formated file.Some of them said read file in Binary format, but i dont know how to read in binary format. Give your suggestion to Read and Writeing of jpeg file format regards shakumar

                  shakumar

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #8

                  shakumar_22 wrote:

                  Some of them said read file in Binary format, but i dont know how to read in binary format.

                  See here for the difference between binary and text files. That said, consult MSDN for the distinction between CFile and CStdioFile.


                  "A good athlete is the result of a good and worthy opponent." - David Crow

                  "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups