converting raw image to bmp or jpeg in c#
-
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
-
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
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."
-
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."
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
-
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
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."
-
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
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. -
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.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."
-
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
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. HTHJeremy Falcon "It's a good thing to do and a tasty way to do it." - Wilford Brimley[^]