Re: 16 bit grayscale tiff
- From: "Michael Phillips, Jr." <mphillips53@xxxxxxxxxxxxxxx>
- Date: Thu, 28 Feb 2008 10:49:30 -0500
I want to process 16 bit grayscale tiff images.
Gdiplus does not support 16bpp grayscale images.
Microsoft's newest imaging library WIC(Windows Imaging Component) does
support 16bpp grayscale images.
See:
http://www.microsoft.com/downloads/details.aspx?FamilyID=8e011506-6307-445b-b950-215def45ddd8&displaylang=en
And:
http://www.microsoft.com/downloads/details.aspx?FamilyID=A6D6EC6A-E4F2-405E-842D-7C3BCB5B1390&displaylang=en
"Fabian" <Fabian@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:10930D5C-3F30-44DC-B4E6-AE146AECE94A@xxxxxxxxxxxxxxxx
I want to process 16 bit grayscale tiff images. My first tests show that
somehow the images are not read correctly. If I just read and save an
image
the resulting image on the disk is only 8 bytes in size. It works though
if I
load a 8 bit grayscale tiff or a 24 bit color bmp instead.
A code snippet:
<snip>
// init GDI+
ULONG_PTR GdiplusToken;
GdiplusStartupInput GdiplusStartupInput;
GdiplusStartup(&GdiplusToken, &GdiplusStartupInput, NULL);
// create Bitmap from disk
WCHAR wchPath[255] = L"F:\\IppTestImages\\NOISE.TIF";
Bitmap* bitmap = new Bitmap(wchPath, NULL);
// save Bitmap
WCHAR wchSavePath[255] = L"F:\\changed.TIF";
CLSID tiffClsid = GUID_NULL;
GetEncoderClsid(L"image/tiff", &tiffClsid);
bitmap->Save(wchSavePath, &tiffClsid, NULL);
// delete Bitmap
delete bitmap;
// uninit GDI+
GdiplusShutdown(GdiplusToken);
</snip>
The GetEncoderClsid-function is from the msdn example at
http://msdn2.microsoft.com/en-us/library/ms533843(VS.85).aspx.
Strangely the meta information is there: bitmap->GetWidth() returns the
proper width.
Thanks in advance for your help,
Fabian
.
- Prev by Date: Re: GetOutlineTextMetrics - Invalid Handle
- Next by Date: Angle gradient?
- Previous by thread: Drawing red line over a window
- Next by thread: Angle gradient?
- Index(es):
Relevant Pages
|