Hi,
In past lives I've coded custom TIF reader/writer code; multi page 12 bit
gray scale images with custom tag data for each page. I dunno how much
support you've got in .NET for all of the many many things that TIF can do -
so the first thing I'd recommend is figure out exactly what TIF features you
need and see if the .NET framework supports them. Questions:
1) In what format is the SQL BLOB data?
2) In addition to multiple pages what other TIF features do you need?
Compression? Bizarre color depth? Grayscale? Custom data tags?
After a quick scan of MSDN, here are some relevant .NET namespaces and
classes:
System.Drawing
Bitmap
Image
ImageConverter
ImageFormatConverter
System.Drawing.Imaging
ImageFormat
If the .NET framework does NOT support what you need then I would seriousely
consider looking for a third party tool that meets your requirements. I used
one last century, I can't remember what it was, I think it was "Image Gear" -
it was a very good tool with an extrememly simple API, try googling on that...
However, if you find yourself in the situation that I was in --> custom gray
scale bitmap format from a newly developed hardware device, requirement for
code with a tiny footprint that could run embedded on the new device, a need
to store TIF custom data tags, and googling and asking everyone you know and
you still couldn't find a tool or API to do it for you. - then you're
probably going to have to write some TIF code...
If you decide to write your own code then I would STRONGLY recommend that
you write the TIF code from C++. I don't have code with me but I do remember
a few things about TIF format 1) byte order for some TIF headers must be hard
coded to little/big endian format {I forget which}, 2) You will find yourself
defining several header structs and then positioning them at various raw byte
offsets in the file as you read/write data. IMHO these lower level byte
manipulation tasks are better suited for C++; I'm certain that you could do
the work from unsafe C# code but C++ code would probably be more natural to
work with...
lotsa luck...
--Richard
P.S. If you do find yourself needing to write your own code {and I hope you
don't} then there is a book out there - I think it's called "The Encyclopedia
of Graphic File Formats" or something like that, it describes TIF format in
exhausting detail...