473,594 Members | 2,768 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help creating TIF and opening

k, here is my issue.. I have BLOB data in SQL that needs to be grabbed and
made into a TIF file and placed on the client (could be in temp internet
dir). The reason we need it in TIF format is there are multiple pages per
invoice.

How can I grab the data, make the TIF, place it on the client and then Open
with the clients default program for veiwing TIF's (usually Microsoft Picture
and Fax Viewer).

Please help.
Nov 16 '05 #1
4 7393
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
ImageFormatConv erter
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...

"Phil" wrote:
k, here is my issue.. I have BLOB data in SQL that needs to be grabbed and
made into a TIF file and placed on the client (could be in temp internet
dir). The reason we need it in TIF format is there are multiple pages per
invoice.

How can I grab the data, make the TIF, place it on the client and then Open
with the clients default program for veiwing TIF's (usually Microsoft Picture
and Fax Viewer).

Please help.

Nov 16 '05 #2
Thanks for your advice Richard. I do not need any specific features of the
TIF format, other than displaying multiple pages. Our business users were ok
even with a GIF format, but could not see page 2, 3, 4 .. so on

The code I am using now will pop up the dialog box to Open or Save the file.
But the File format is coming up as ASPX rather than TIF. If I choose save
and change the extension, I can save the file and open it with Picture and
Fax viewer... but it is too many steps for the end user. It would be ideal to
stream this data and have the dialog pop up and either open the Micro P & F
viewer or save it to the client (with the correct extension. Here is the
simple code.

qlConnection myConn = new
SqlConnection(C onfigurationSet tings.AppSettin gs["strConnect ion"]);
SqlCommand myComm = new SqlCommand("Sel ect SX_Image_Data from
SX_ACCSXDB_Imag es where chrBarCode = '" + Request.QuerySt ring["invoice"] +
"'",myConn) ;

myConn.Open();

byte [] img = (byte[]) myComm.ExecuteS calar();
Response.Conten tType = "image/tiff";
Response.Binary Write(img);

myConn.Close();

Nov 16 '05 #3
I have been developing on a TIFF library for almost a month now.
It seems to turn out good.
We needed native TIFF support for our PDF library because
we need to support other color spaces than RGB, mainly CMYK.
It supports any public or private tags with the same approach as
System.Drawing. Image;
it uses a collection of meta data properties to provide them all.
Even if the tag is not known by the library, it still extracts the tag data
and exposes it for reading and writing.

However, You do not mention anything about additional color spaces other
than RGB.
Therefore, i think the only thing you will need is System.Drawing. Bitmap.
AFAIK, It supports decoding any types of TIFF files compressed with any
algorithm supported
by TIFF, including LZW, JPEG, PackBits and CCITT and decodes in any color
space,
but converts it to RGB.
If you have no problem with using RGB only, just use System.Drawing. Bitmap
to load the image and use the overloaded Save method which also takes an
output format
to specify that you want the TIFF output format.
--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"Richard" <Ri*****@discus sions.microsoft .com> wrote in message
news:29******** *************** ***********@mic rosoft.com...
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
ImageFormatConv erter
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...

"Phil" wrote:
k, here is my issue.. I have BLOB data in SQL that needs to be grabbed
and
made into a TIF file and placed on the client (could be in temp internet
dir). The reason we need it in TIF format is there are multiple pages per
invoice.

How can I grab the data, make the TIF, place it on the client and then
Open
with the clients default program for veiwing TIF's (usually Microsoft
Picture
and Fax Viewer).

Please help.

Nov 16 '05 #4
I hope this post isn't too old...

I am working on converting tiff's now as well. My main problem at this
point is that I'm trying to switch the byte order. I get tiff's sent to me
that are intel(little endian) and my system will only work with motorola(big
endian). I am having a hard time finding anything in the .NET framework to
convert this.

Any help would be greatly appreciated.

thanks
dave

"Phil" wrote:
k, here is my issue.. I have BLOB data in SQL that needs to be grabbed and
made into a TIF file and placed on the client (could be in temp internet
dir). The reason we need it in TIF format is there are multiple pages per
invoice.

How can I grab the data, make the TIF, place it on the client and then Open
with the clients default program for veiwing TIF's (usually Microsoft Picture
and Fax Viewer).

Please help.

Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
49433
by: gonzal | last post by:
Hi Dose any body know why a temporary table gets deleted after querying it the first time (using SELECT INTO)? When I run the code bellow I'm getting an error message when open the temp table for the second time. Error Type: Microsoft OLE DB Provider for SQL Server (0x80040E37) Invalid object name '#testtable'.
5
3777
by: Ken Varn | last post by:
I have a named mutex object that is accessed by both an asp.net application and a Windows executable .net application. The Windows executable runs under the administrator logon, while the asp.net application runs under the standard asp.net user account. The problem relates to permissions on creation of the mutex. If the asp.net application creates the mutex, the executable cannot access it (access denied error). Likewise, if the...
0
1115
by: SQLReporter | last post by:
Hi, I am getting following error when opening/creating web projects in VS.NET... --------------------------- Microsoft Development Environment --------------------------- The Web server reported the following error when attempting to create or open the Web project located at the following URL: 'http://localhost/WebService1'. 'HTTP/1.1 403 Forbidden'. ---------------------------
1
1515
by: Jarrod Hyder | last post by:
Ok, I wrote my own weblog and I'm working on the web interface for adding/editing my posts. I decided to add a little preview button...when the button is clicked it is suppose to open a pop-up window. I wrote the whole preview function in javascript so that I don't have to reload the page to see a preview. Here is the code I wrote that doesn't work at all: Code:
7
1846
by: Susan Bricker | last post by:
Greetings. As a relative newcomer to Access, I am having trouble deciding on how to design the form flow for updating and creating related records. I'm looking for a variety of suggestions so that I can decide what's best for the user and what's best for screen flow. Here's the structure: I have what's called "an Event". Each Event can have multiple "Trials". Each "Trial" can multiple "Classes". (This is the structure for a dog...
7
1543
by: pillip | last post by:
I am trying to use fopen and fget to input two files and then output them into one file. Each input file has two columns and 20 rows, however since the first column in each input file is same ( numbers 0...19), i want the output file to have 3 columns and 20 rows. Right now i am using a one dimensional array "array1" to input each file:, and the output file has 2 columns and 42 rows. #include <stdlib.h> #include <stdio.h>
7
2524
by: fox | last post by:
Hi, Lacking javascript knowledge, I just realized why my project has a bug. I am using ASP to loop through a set of records while it creates URLs with a querystring that has a single value pair. This URL needs to open in a floating window if clicked. (this is for an administrator and so opening a small floater gives them more efficient access to the data that will be displayed). I now understand that because the ASP executes first, that...
11
4479
by: Alan Mailer | last post by:
A project I'm working on is going to use VB6 as a front end. The back end is going to be pre-existing MS Access 2002 database tables which already have records in them *but do not have any AutoNumber* fields in them. Correct me if I'm wrong, but I'm assuming this means that I cannot now alter these existing Access tables and change their primary key to an "AutoNumber" type. If I'm right about this, I need some suggestions as to the...
2
1868
bmallett
by: bmallett | last post by:
I am getting the following error: Error Type: ADODB.Command (0x800A0BB9) Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. /dcme/newframe/verify.asp, line 48 Line 48 is:
0
7874
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
7997
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8230
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6647
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5738
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3854
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2383
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1471
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1204
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.