How to read jpg file in C using turbo C

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HabibBhutto
    New Member
    • Jan 2009
    • 17

    How to read jpg file in C using turbo C

    Hi all,

    Thanx in Advance.. !

    anyone can tel me that what is the architecture of jpg image file and .bmp image file. I want to display images in c evironment using conventional graphics and by programming the vga card. But i dont know the arcitecture of image files. plzzzzzz help me... in this regard... !

    I will be thankful to u... !

    Thanks again... in advance... !
  • george666
    New Member
    • Jul 2008
    • 28

    #2
    Turbo C is obsolete.
    On Windows, use C/Win32 api : 2 lines of code to load a jpg or any graphic format.

    Comment

    • newb16
      Contributor
      • Jul 2008
      • 687

      #3
      If it were 32bit platform I would suggested freeimage that is opensource. But on 16-bit it would be tough. I would use some free jpg-to-bmp converter and run it from my program when needed. But ... wait. Is self-made jpg decompressor an essential part of your homework?

      Comment

      • george666
        New Member
        • Jul 2008
        • 28

        #4
        frreimage is useless nowadays
        As I said, all image formats are native on Win32.

        Comment

        • HabibBhutto
          New Member
          • Jan 2009
          • 17

          #5
          george, from where i may get the c/win32 api???
          is it third party api ???
          yaar i m tried to do it i got fifty percent work
          but there is a problem
          for example there is a bmp image file, its size is (x = 354, y= 322)
          i opened it and i count its number of rows and columns per row
          i found 1024 columns/row and total number of rows are 335

          so in this regard 1024/354 = near to 3 it mans each pixel have three values and i started to take values for colors from row no 14 becuase 335 - 14 = 322 now i found a picture on screen of the size 354x322 but it is not proper displayed problem is that how to combine these rgb colors i used setrgbpallete() but i was failed to get colors... !

          Comment

          • newb16
            Contributor
            • Jul 2008
            • 687

            #6
            Originally posted by HabibBhutto
            george, from where i may get the c/win32 api???
            is it third party api ???
            IWICBitmapDecod er Interface ()
            and around. Note minimal system reqs.

            problem is that how to combine these rgb colors i used setrgbpallete() but i was failed to get colors... !
            How many paletter entruies are there on your vga? 16 ? Not so much.

            Comment

            • abdul hanan
              New Member
              • Apr 2011
              • 3

              #7
              i have almost same project. but i get image code on compiler when i write this code on another file.tht will nt work properly. habib can u show me tht how u read image.?

              Comment

              Working...