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. Graphics
  4. converting raw image to bmp or jpeg in c#

converting raw image to bmp or jpeg in c#

Scheduled Pinned Locked Moved Graphics
csharphelptutorial
7 Posts 4 Posters 8 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.
  • G Offline
    G Offline
    gskumar111
    wrote on last edited by
    #1

    hi all, in my project i need to convert raw image to bmp or jpeg and i have some images with the extention .gry i dont know this is raw or any other special format but i am thinking this is a raw format so my problem is convert .gry image to bmp or jpeg in c# so plz any one knows the way how to do it is plz tell me thanks in advance Regards, santhosh

    M J 2 Replies Last reply
    0
    • G gskumar111

      hi all, in my project i need to convert raw image to bmp or jpeg and i have some images with the extention .gry i dont know this is raw or any other special format but i am thinking this is a raw format so my problem is convert .gry image to bmp or jpeg in c# so plz any one knows the way how to do it is plz tell me thanks in advance Regards, santhosh

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      You could use the System.Drawing.Bitmap class to create a bitmap of the appropriate bits-per-pixel and copy the raw pixel data to it. Do you have specs for the gry file format? Mark

      "Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot? Of course you don't, no one does. It never happens. It's a dumb question... skip it."

      G 1 Reply Last reply
      0
      • M Mark Salsbery

        You could use the System.Drawing.Bitmap class to create a bitmap of the appropriate bits-per-pixel and copy the raw pixel data to it. Do you have specs for the gry file format? Mark

        "Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot? Of course you don't, no one does. It never happens. It's a dumb question... skip it."

        G Offline
        G Offline
        gskumar111
        wrote on last edited by
        #3

        No mark i don't have any specs for that gry file according to my project document i have to take that gry image as input and displaying that into picture box plz tell me the way how can i read this type of images in c# and tell if any tutorial for this problem for reference Regards, santhosh

        M P 2 Replies Last reply
        0
        • G gskumar111

          No mark i don't have any specs for that gry file according to my project document i have to take that gry image as input and displaying that into picture box plz tell me the way how can i read this type of images in c# and tell if any tutorial for this problem for reference Regards, santhosh

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          I'm not a C# programmer but C# uses .NET right? If so, check out the System.Drawing.Bitmap class. If you have the dimensions and pixel format of the raw pixel data then you can create a Bitmap object with the same format and copy the pixel data into it. Then it can be saved in a variety of formats. Mark

          "Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot? Of course you don't, no one does. It never happens. It's a dumb question... skip it."

          1 Reply Last reply
          0
          • G gskumar111

            No mark i don't have any specs for that gry file according to my project document i have to take that gry image as input and displaying that into picture box plz tell me the way how can i read this type of images in c# and tell if any tutorial for this problem for reference Regards, santhosh

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            gry (or RAW GREY format) is an image format that is not supported by the image classes in .NET. This means that you are going to have to write your own converter I'm afraid.

            the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
            Deja View - the feeling that you've seen this post before.

            M 1 Reply Last reply
            0
            • P Pete OHanlon

              gry (or RAW GREY format) is an image format that is not supported by the image classes in .NET. This means that you are going to have to write your own converter I'm afraid.

              the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
              Deja View - the feeling that you've seen this post before.

              M Offline
              M Offline
              Mark Salsbery
              wrote on last edited by
              #6

              Pete O`Hanlon wrote:

              This means that you are going to have to write your own converter I'm afraid.

              I think that's what he wants to do. I'd post a C++ sample but I can't find any info on the format. How to extract dimensions and pixel format would be helpful! :) Do you know the Raw Grey format? Mark

              "Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot? Of course you don't, no one does. It never happens. It's a dumb question... skip it."

              1 Reply Last reply
              0
              • G gskumar111

                hi all, in my project i need to convert raw image to bmp or jpeg and i have some images with the extention .gry i dont know this is raw or any other special format but i am thinking this is a raw format so my problem is convert .gry image to bmp or jpeg in c# so plz any one knows the way how to do it is plz tell me thanks in advance Regards, santhosh

                J Offline
                J Offline
                Jeremy Falcon
                wrote on last edited by
                #7

                I don't use .NET, but the process will generally be the same. So, I'll speak in a bit of a psuedocode to get you pointed in the right direction at least. Most RAW image files use the .raw extension out of custom although I've heard of .gry too so you're most likely right on that. Just Google for info on the RAW image file header format. To know how to make heads or tails out of the file data. Here's one actually... http://download-east.oracle.com/docs/cd/B10501_01/appdev.920/a88786/mm_raw.htm[^] The good news is, a RAW image is raw data and a breeze to read into a buffer that libjpg or CreateBitmapIndirect() (Windows API) can understand. There are also a lot of unmanaged libs out there that will do this. HTH

                Jeremy Falcon "It's a good thing to do and a tasty way to do it." - Wilford Brimley[^]

                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