473,837 Members | 1,617 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TIFF/Image clean-up / compression component

Ben
Hi

We are looking for a component that offers that offers the below for Tiff
files:

Image clean-up (deskew, despeckle)
Printing capabilities from VB
The ability to add text to image, e.g. time / date

Nice to have:
Image compression/optimisation.
The above for PDFs

Future options:
OCR capabilities
We have been looking at www.vintasoft.com/ which is excellently priced at
$50 US, but does not offer Printing / Addition of Text.

Other options we have looked at are well over $1000 dollars and often
requires expensive runtime licences.

Are there any low cost alternatives that do not sacrifice functionality.

Thanks
B
Mar 5 '07 #1
7 3799
I have added text to an image. It is fairly easy.

As to printing an image, I haven't tried it in VB. A Google search produces
some examples, e.g. http://www.codeproject.com/useritems/PrintBasics.asp.

So possibly you could do a call to their software to clean up the file and
then do your own text addition and printing.
"Ben" <Be*@Newsgroups .microsoft.comw rote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
Hi

We are looking for a component that offers that offers the below for Tiff
files:

Image clean-up (deskew, despeckle)
Printing capabilities from VB
The ability to add text to image, e.g. time / date

Nice to have:
Image compression/optimisation.
The above for PDFs

Future options:
OCR capabilities
We have been looking at www.vintasoft.com/ which is excellently priced at
$50 US, but does not offer Printing / Addition of Text.

Other options we have looked at are well over $1000 dollars and often
requires expensive runtime licences.

Are there any low cost alternatives that do not sacrifice functionality.

Thanks
B

Mar 5 '07 #2

how easy is it to add text to a tiff? and example would be nice for those
of us that do not find it that easy.

thanks

"William LaMartin" <la******@tampa bay.rr.comwrote in message
news:u9******** ******@TK2MSFTN GP04.phx.gbl...
>I have added text to an image. It is fairly easy.

As to printing an image, I haven't tried it in VB. A Google search
produces some examples, e.g.
http://www.codeproject.com/useritems/PrintBasics.asp.

So possibly you could do a call to their software to clean up the file and
then do your own text addition and printing.
"Ben" <Be*@Newsgroups .microsoft.comw rote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
>Hi

We are looking for a component that offers that offers the below for Tiff
files:

Image clean-up (deskew, despeckle)
Printing capabilities from VB
The ability to add text to image, e.g. time / date

Nice to have:
Image compression/optimisation.
The above for PDFs

Future options:
OCR capabilities
We have been looking at www.vintasoft.com/ which is excellently priced at
$50 US, but does not offer Printing / Addition of Text.

Other options we have looked at are well over $1000 dollars and often
requires expensive runtime licences.

Are there any low cost alternatives that do not sacrifice functionality.

Thanks
B


Mar 6 '07 #3
Here is code that will allow you to select a jpg file, look for a creation
date in the EXIF info of the header and if such is found print it in red
text in the lower left hand corner of the image which is then displayed in a
picturebox on the form.

You could modify it to print any text you wish in any location on the image
and then save it to a file. To do a Tiff just make the appropriate changes
(I am not up on any information in the header of tiff files so this part
would have to be omitted)

Dim MyText As String = ""

Dim encoding As System.Text.Enc oding = System.Text.Enc oding.UTF8

Dim OpenFileDialog1 As New OpenFileDialog

OpenFileDialog1 .Filter = "Jpeg Files(*.JPG)|*. JPG"

OpenFileDialog1 .ShowReadOnly = False

If Not OpenFileDialog1 .ShowDialog = DialogResult.OK Then Exit Sub

Try

SourceFile = OpenFileDialog1 .FileName

MyImage = New Bitmap(OpenFile Dialog1.FileNam e)

Dim AProp As System.Drawing. Imaging.Propert yItem

'Scan through all the property items (if any) in image

'and put them into the string s

For Each AProp In MyImage.Propert yItems

Try 'Some cameras are non-standard; hence TryCatch

Select Case AProp.Id.ToStri ng("x")

Case "9003" 'Date

If Trim(encoding.G etString(AProp. Value)) <_

"" Then

MyText = encoding.GetStr ing(AProp.Value ) & vbNewLine

Else

MsgBox("There is no Creation date for the photo")

Exit Sub

End If

End Select

Catch

End Try

Next

MyText = Replace(MyText, Chr(0), "")

If MyText = "" Then

MyText = "No EXIF information with this image"

MsgBox(MyText)

Exit Sub

End If

'now write the date on the image

Dim g As System.Drawing. Graphics

g = Graphics.FromIm age(MyImage)

g.TextRendering Hint = Drawing.Text.Te xtRenderingHint .AntiAliasGridF it

Dim objFont As Font = New Font("Arial", 16, FontStyle.Bold,
GraphicsUnit.Pi xel)

' Write out the text

g.DrawString(My Text, objFont, Brushes.Red, 3, MyImage.Height - 20)

Me.PictureBox1. Image = MyImage

Catch ex As Exception

MsgBox(ex.Messa ge.ToString)

End Try
"jeff" <jhersey at allnorth dottt comwrote in message
news:um******** ******@TK2MSFTN GP02.phx.gbl...
>
how easy is it to add text to a tiff? and example would be nice for those
of us that do not find it that easy.

thanks

"William LaMartin" <la******@tampa bay.rr.comwrote in message
news:u9******** ******@TK2MSFTN GP04.phx.gbl...
>>I have added text to an image. It is fairly easy.

As to printing an image, I haven't tried it in VB. A Google search
produces some examples, e.g.
http://www.codeproject.com/useritems/PrintBasics.asp.

So possibly you could do a call to their software to clean up the file
and then do your own text addition and printing.
"Ben" <Be*@Newsgroups .microsoft.comw rote in message
news:%2******* *********@TK2MS FTNGP04.phx.gbl ...
>>Hi

We are looking for a component that offers that offers the below for
Tiff files:

Image clean-up (deskew, despeckle)
Printing capabilities from VB
The ability to add text to image, e.g. time / date

Nice to have:
Image compression/optimisation.
The above for PDFs

Future options:
OCR capabilities
We have been looking at www.vintasoft.com/ which is excellently priced
at $50 US, but does not offer Printing / Addition of Text.

Other options we have looked at are well over $1000 dollars and often
requires expensive runtime licences.

Are there any low cost alternatives that do not sacrifice functionality.

Thanks
B



Mar 7 '07 #4
William,

this does not add the text to the actual file... it only over-lays a
control.

I think that the OP wants to be able to add Text Annotation to a TIF file,
and either FAX or PRINT the TIF file with this extra information.

My interest lies in the ability to add the TEXT annotation to directly in
the TIF file ... I have an application that needs to distribute patient care
forms - either by fax or secure email. The care forms, a scanned image
(tif), are stored in the database and each time they are needed, a local
temp file is created on the host machine. What I would like to be able to
do, is when i create the TIF, I would like to add 'Database Fields' to the
header of the TIF (text annotation). The problem is, I can not use a visual
control to do this 'overlay' - as I need to be able to print / fax this file
as seen on the screen and as it is stored in the temporary file. It must be
able to handle a non-visual environment as I have a fax service that runs
unattended on a seperate machine and must be able to do this with out a
VISUAL component.

So, for display purposes, this works fine for jpg's bmp's, gifs and so on -
tradition IMAGE files ... I am not too sure it will work with TIF's or not -
as these are not typical 'image files'. As far as actually adding the text
to the TIF file, this does not work.

Jeff.


"William LaMartin" <la******@tampa bay.rr.comwrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
Here is code that will allow you to select a jpg file, look for a creation
date in the EXIF info of the header and if such is found print it in red
text in the lower left hand corner of the image which is then displayed in
a picturebox on the form.

You could modify it to print any text you wish in any location on the
image and then save it to a file. To do a Tiff just make the appropriate
changes (I am not up on any information in the header of tiff files so
this part would have to be omitted)

Dim MyText As String = ""

Dim encoding As System.Text.Enc oding = System.Text.Enc oding.UTF8

Dim OpenFileDialog1 As New OpenFileDialog

OpenFileDialog1 .Filter = "Jpeg Files(*.JPG)|*. JPG"

OpenFileDialog1 .ShowReadOnly = False

If Not OpenFileDialog1 .ShowDialog = DialogResult.OK Then Exit Sub

Try

SourceFile = OpenFileDialog1 .FileName

MyImage = New Bitmap(OpenFile Dialog1.FileNam e)

Dim AProp As System.Drawing. Imaging.Propert yItem

'Scan through all the property items (if any) in image

'and put them into the string s

For Each AProp In MyImage.Propert yItems

Try 'Some cameras are non-standard; hence TryCatch

Select Case AProp.Id.ToStri ng("x")

Case "9003" 'Date

If Trim(encoding.G etString(AProp. Value)) <_

"" Then

MyText = encoding.GetStr ing(AProp.Value ) & vbNewLine

Else

MsgBox("There is no Creation date for the photo")

Exit Sub

End If

End Select

Catch

End Try

Next

MyText = Replace(MyText, Chr(0), "")

If MyText = "" Then

MyText = "No EXIF information with this image"

MsgBox(MyText)

Exit Sub

End If

'now write the date on the image

Dim g As System.Drawing. Graphics

g = Graphics.FromIm age(MyImage)

g.TextRendering Hint = Drawing.Text.Te xtRenderingHint .AntiAliasGridF it

Dim objFont As Font = New Font("Arial", 16, FontStyle.Bold,
GraphicsUnit.Pi xel)

' Write out the text

g.DrawString(My Text, objFont, Brushes.Red, 3, MyImage.Height - 20)

Me.PictureBox1. Image = MyImage

Catch ex As Exception

MsgBox(ex.Messa ge.ToString)

End Try
"jeff" <jhersey at allnorth dottt comwrote in message
news:um******** ******@TK2MSFTN GP02.phx.gbl...
>>
how easy is it to add text to a tiff? and example would be nice for
those of us that do not find it that easy.

thanks

"William LaMartin" <la******@tampa bay.rr.comwrote in message
news:u9******* *******@TK2MSFT NGP04.phx.gbl.. .
>>>I have added text to an image. It is fairly easy.

As to printing an image, I haven't tried it in VB. A Google search
produces some examples, e.g.
http://www.codeproject.com/useritems/PrintBasics.asp.

So possibly you could do a call to their software to clean up the file
and then do your own text addition and printing.
"Ben" <Be*@Newsgroups .microsoft.comw rote in message
news:%2****** **********@TK2M SFTNGP04.phx.gb l...
Hi

We are looking for a component that offers that offers the below for
Tiff files:

Image clean-up (deskew, despeckle)
Printing capabilities from VB
The ability to add text to image, e.g. time / date

Nice to have:
Image compression/optimisation.
The above for PDFs

Future options:
OCR capabilities
We have been looking at www.vintasoft.com/ which is excellently priced
at $50 US, but does not offer Printing / Addition of Text.

Other options we have looked at are well over $1000 dollars and often
requires expensive runtime licences.

Are there any low cost alternatives that do not sacrifice
functionalit y.

Thanks
B



Mar 7 '07 #5
Yes. But then you can simply save the image to a file. In the code I
posted, MyImage was a form-wide declared image (which was also used as the
source of the picturebox). To save MyImage which now has the date written
on it, simply do a MyImage.Save(th e path to save to). With Jpegs there are
compression considerations, but with a TIFF that isn't a consideration.


"jeff" <jhersey at allnorth dottt comwrote in message
news:eV******** ******@TK2MSFTN GP05.phx.gbl...
William,

this does not add the text to the actual file... it only over-lays a
control.

I think that the OP wants to be able to add Text Annotation to a TIF file,
and either FAX or PRINT the TIF file with this extra information.

My interest lies in the ability to add the TEXT annotation to directly in
the TIF file ... I have an application that needs to distribute patient
care forms - either by fax or secure email. The care forms, a scanned
image (tif), are stored in the database and each time they are needed, a
local temp file is created on the host machine. What I would like to be
able to do, is when i create the TIF, I would like to add 'Database
Fields' to the header of the TIF (text annotation). The problem is, I can
not use a visual control to do this 'overlay' - as I need to be able to
print / fax this file as seen on the screen and as it is stored in the
temporary file. It must be able to handle a non-visual environment as I
have a fax service that runs unattended on a seperate machine and must be
able to do this with out a VISUAL component.

So, for display purposes, this works fine for jpg's bmp's, gifs and so
on - tradition IMAGE files ... I am not too sure it will work with TIF's
or not - as these are not typical 'image files'. As far as actually
adding the text to the TIF file, this does not work.

Jeff.


"William LaMartin" <la******@tampa bay.rr.comwrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
>Here is code that will allow you to select a jpg file, look for a
creation date in the EXIF info of the header and if such is found print
it in red text in the lower left hand corner of the image which is then
displayed in a picturebox on the form.

You could modify it to print any text you wish in any location on the
image and then save it to a file. To do a Tiff just make the appropriate
changes (I am not up on any information in the header of tiff files so
this part would have to be omitted)

Dim MyText As String = ""

Dim encoding As System.Text.Enc oding = System.Text.Enc oding.UTF8

Dim OpenFileDialog1 As New OpenFileDialog

OpenFileDialog 1.Filter = "Jpeg Files(*.JPG)|*. JPG"

OpenFileDialog 1.ShowReadOnly = False

If Not OpenFileDialog1 .ShowDialog = DialogResult.OK Then Exit Sub

Try

SourceFile = OpenFileDialog1 .FileName

MyImage = New Bitmap(OpenFile Dialog1.FileNam e)

Dim AProp As System.Drawing. Imaging.Propert yItem

'Scan through all the property items (if any) in image

'and put them into the string s

For Each AProp In MyImage.Propert yItems

Try 'Some cameras are non-standard; hence TryCatch

Select Case AProp.Id.ToStri ng("x")

Case "9003" 'Date

If Trim(encoding.G etString(AProp. Value)) <_

"" Then

MyText = encoding.GetStr ing(AProp.Value ) & vbNewLine

Else

MsgBox("There is no Creation date for the photo")

Exit Sub

End If

End Select

Catch

End Try

Next

MyText = Replace(MyText, Chr(0), "")

If MyText = "" Then

MyText = "No EXIF information with this image"

MsgBox(MyText)

Exit Sub

End If

'now write the date on the image

Dim g As System.Drawing. Graphics

g = Graphics.FromIm age(MyImage)

g.TextRenderin gHint = Drawing.Text.Te xtRenderingHint .AntiAliasGridF it

Dim objFont As Font = New Font("Arial", 16, FontStyle.Bold,
GraphicsUnit.P ixel)

' Write out the text

g.DrawString(My Text, objFont, Brushes.Red, 3, MyImage.Height - 20)

Me.PictureBox1. Image = MyImage

Catch ex As Exception

MsgBox(ex.Messa ge.ToString)

End Try
"jeff" <jhersey at allnorth dottt comwrote in message
news:um******* *******@TK2MSFT NGP02.phx.gbl.. .
>>>
how easy is it to add text to a tiff? and example would be nice for
those of us that do not find it that easy.

thanks

"William LaMartin" <la******@tampa bay.rr.comwrote in message
news:u9****** ********@TK2MSF TNGP04.phx.gbl. ..
I have added text to an image. It is fairly easy.

As to printing an image, I haven't tried it in VB. A Google search
produces some examples, e.g.
http://www.codeproject.com/useritems/PrintBasics.asp.

So possibly you could do a call to their software to clean up the file
and then do your own text addition and printing.
"Ben" <Be*@Newsgroups .microsoft.comw rote in message
news:%2***** ***********@TK2 MSFTNGP04.phx.g bl...
Hi
>
We are looking for a component that offers that offers the below for
Tiff files:
>
Image clean-up (deskew, despeckle)
Printing capabilities from VB
The ability to add text to image, e.g. time / date
>
Nice to have:
Image compression/optimisation.
The above for PDFs
>
Future options:
OCR capabilities
>
>
We have been looking at www.vintasoft.com/ which is excellently priced
at $50 US, but does not offer Printing / Addition of Text.
>
Other options we have looked at are well over $1000 dollars and often
requires expensive runtime licences.
>
Are there any low cost alternatives that do not sacrifice
functionali ty.
>
Thanks
B
>




Mar 7 '07 #6

As expected, your code does not work with TIF files ... get the following
error...
>>A Graphics object cannot be created from an image that has an indexed
pixel format.<<
So, again, I ask you how easy it is to add text (annotation) to a TIF
file... as per OP request.

Thanks
Jeff

"William LaMartin" <la******@tampa bay.rr.comwrote in message
news:et******** ******@TK2MSFTN GP06.phx.gbl...
Yes. But then you can simply save the image to a file. In the code I
posted, MyImage was a form-wide declared image (which was also used as the
source of the picturebox). To save MyImage which now has the date written
on it, simply do a MyImage.Save(th e path to save to). With Jpegs there
are compression considerations, but with a TIFF that isn't a
consideration.


"jeff" <jhersey at allnorth dottt comwrote in message
news:eV******** ******@TK2MSFTN GP05.phx.gbl...
>William,

this does not add the text to the actual file... it only over-lays a
control.

I think that the OP wants to be able to add Text Annotation to a TIF
file, and either FAX or PRINT the TIF file with this extra information.

My interest lies in the ability to add the TEXT annotation to directly in
the TIF file ... I have an application that needs to distribute patient
care forms - either by fax or secure email. The care forms, a scanned
image (tif), are stored in the database and each time they are needed, a
local temp file is created on the host machine. What I would like to be
able to do, is when i create the TIF, I would like to add 'Database
Fields' to the header of the TIF (text annotation). The problem is, I
can not use a visual control to do this 'overlay' - as I need to be able
to print / fax this file as seen on the screen and as it is stored in the
temporary file. It must be able to handle a non-visual environment as I
have a fax service that runs unattended on a seperate machine and must be
able to do this with out a VISUAL component.

So, for display purposes, this works fine for jpg's bmp's, gifs and so
on - tradition IMAGE files ... I am not too sure it will work with TIF's
or not - as these are not typical 'image files'. As far as actually
adding the text to the TIF file, this does not work.

Jeff.


"William LaMartin" <la******@tampa bay.rr.comwrote in message
news:%2******* *********@TK2MS FTNGP05.phx.gbl ...
>>Here is code that will allow you to select a jpg file, look for a
creation date in the EXIF info of the header and if such is found print
it in red text in the lower left hand corner of the image which is then
displayed in a picturebox on the form.

You could modify it to print any text you wish in any location on the
image and then save it to a file. To do a Tiff just make the
appropriate changes (I am not up on any information in the header of
tiff files so this part would have to be omitted)

Dim MyText As String = ""

Dim encoding As System.Text.Enc oding = System.Text.Enc oding.UTF8

Dim OpenFileDialog1 As New OpenFileDialog

OpenFileDialo g1.Filter = "Jpeg Files(*.JPG)|*. JPG"

OpenFileDialo g1.ShowReadOnly = False

If Not OpenFileDialog1 .ShowDialog = DialogResult.OK Then Exit Sub

Try

SourceFile = OpenFileDialog1 .FileName

MyImage = New Bitmap(OpenFile Dialog1.FileNam e)

Dim AProp As System.Drawing. Imaging.Propert yItem

'Scan through all the property items (if any) in image

'and put them into the string s

For Each AProp In MyImage.Propert yItems

Try 'Some cameras are non-standard; hence TryCatch

Select Case AProp.Id.ToStri ng("x")

Case "9003" 'Date

If Trim(encoding.G etString(AProp. Value)) <_

"" Then

MyText = encoding.GetStr ing(AProp.Value ) & vbNewLine

Else

MsgBox("There is no Creation date for the photo")

Exit Sub

End If

End Select

Catch

End Try

Next

MyText = Replace(MyText, Chr(0), "")

If MyText = "" Then

MyText = "No EXIF information with this image"

MsgBox(MyText)

Exit Sub

End If

'now write the date on the image

Dim g As System.Drawing. Graphics

g = Graphics.FromIm age(MyImage)

g.TextRenderi ngHint = Drawing.Text.Te xtRenderingHint .AntiAliasGridF it

Dim objFont As Font = New Font("Arial", 16, FontStyle.Bold,
GraphicsUnit. Pixel)

' Write out the text

g.DrawString(My Text, objFont, Brushes.Red, 3, MyImage.Height - 20)

Me.PictureBox1. Image = MyImage

Catch ex As Exception

MsgBox(ex.Messa ge.ToString)

End Try
"jeff" <jhersey at allnorth dottt comwrote in message
news:um****** ********@TK2MSF TNGP02.phx.gbl. ..

how easy is it to add text to a tiff? and example would be nice for
those of us that do not find it that easy.

thanks

"William LaMartin" <la******@tampa bay.rr.comwrote in message
news:u9***** *********@TK2MS FTNGP04.phx.gbl ...
>I have added text to an image. It is fairly easy.
>
As to printing an image, I haven't tried it in VB. A Google search
produces some examples, e.g.
http://www.codeproject.com/useritems/PrintBasics.asp.
>
So possibly you could do a call to their software to clean up the file
and then do your own text addition and printing.
>
>
"Ben" <Be*@Newsgroups .microsoft.comw rote in message
news:%2**** ************@TK 2MSFTNGP04.phx. gbl...
>Hi
>>
>We are looking for a component that offers that offers the below for
>Tiff files:
>>
>Image clean-up (deskew, despeckle)
>Printing capabilities from VB
>The ability to add text to image, e.g. time / date
>>
>Nice to have:
>Image compression/optimisation.
>The above for PDFs
>>
>Future options:
>OCR capabilities
>>
>>
>We have been looking at www.vintasoft.com/ which is excellently
>priced at $50 US, but does not offer Printing / Addition of Text.
>>
>Other options we have looked at are well over $1000 dollars and often
>requires expensive runtime licences.
>>
>Are there any low cost alternatives that do not sacrifice
>functional ity.
>>
>Thanks
>B
>>
>
>




Mar 7 '07 #7
Well, TIFF covers a lot of different modes: Indexed Color, RGB, Grayscale,
CMYK. So in whatever program that is being used to create the TIFF in the
first place, have it save the file in a non-indexed mode, e.g. RGB

"jeff" <jhersey at allnorth dottt comwrote in message
news:u9******** ******@TK2MSFTN GP02.phx.gbl...
>
As expected, your code does not work with TIF files ... get the following
error...
>>>A Graphics object cannot be created from an image that has an indexed
pixel format.<<

So, again, I ask you how easy it is to add text (annotation) to a TIF
file... as per OP request.

Thanks
Jeff

"William LaMartin" <la******@tampa bay.rr.comwrote in message
news:et******** ******@TK2MSFTN GP06.phx.gbl...
>Yes. But then you can simply save the image to a file. In the code I
posted, MyImage was a form-wide declared image (which was also used as
the source of the picturebox). To save MyImage which now has the date
written on it, simply do a MyImage.Save(th e path to save to). With Jpegs
there are compression considerations, but with a TIFF that isn't a
consideratio n.


"jeff" <jhersey at allnorth dottt comwrote in message
news:eV******* *******@TK2MSFT NGP05.phx.gbl.. .
>>William,

this does not add the text to the actual file... it only over-lays a
control.

I think that the OP wants to be able to add Text Annotation to a TIF
file, and either FAX or PRINT the TIF file with this extra information.

My interest lies in the ability to add the TEXT annotation to directly
in the TIF file ... I have an application that needs to distribute
patient care forms - either by fax or secure email. The care forms, a
scanned image (tif), are stored in the database and each time they are
needed, a local temp file is created on the host machine. What I would
like to be able to do, is when i create the TIF, I would like to add
'Database Fields' to the header of the TIF (text annotation). The
problem is, I can not use a visual control to do this 'overlay' - as I
need to be able to print / fax this file as seen on the screen and as it
is stored in the temporary file. It must be able to handle a non-visual
environment as I have a fax service that runs unattended on a seperate
machine and must be able to do this with out a VISUAL component.

So, for display purposes, this works fine for jpg's bmp's, gifs and so
on - tradition IMAGE files ... I am not too sure it will work with TIF's
or not - as these are not typical 'image files'. As far as actually
adding the text to the TIF file, this does not work.

Jeff.


"William LaMartin" <la******@tampa bay.rr.comwrote in message
news:%2****** **********@TK2M SFTNGP05.phx.gb l...
Here is code that will allow you to select a jpg file, look for a
creation date in the EXIF info of the header and if such is found print
it in red text in the lower left hand corner of the image which is then
displayed in a picturebox on the form.

You could modify it to print any text you wish in any location on the
image and then save it to a file. To do a Tiff just make the
appropriat e changes (I am not up on any information in the header of
tiff files so this part would have to be omitted)

Dim MyText As String = ""

Dim encoding As System.Text.Enc oding = System.Text.Enc oding.UTF8

Dim OpenFileDialog1 As New OpenFileDialog

OpenFileDial og1.Filter = "Jpeg Files(*.JPG)|*. JPG"

OpenFileDial og1.ShowReadOnl y = False

If Not OpenFileDialog1 .ShowDialog = DialogResult.OK Then Exit Sub

Try

SourceFile = OpenFileDialog1 .FileName

MyImage = New Bitmap(OpenFile Dialog1.FileNam e)

Dim AProp As System.Drawing. Imaging.Propert yItem

'Scan through all the property items (if any) in image

'and put them into the string s

For Each AProp In MyImage.Propert yItems

Try 'Some cameras are non-standard; hence TryCatch

Select Case AProp.Id.ToStri ng("x")

Case "9003" 'Date

If Trim(encoding.G etString(AProp. Value)) <_

"" Then

MyText = encoding.GetStr ing(AProp.Value ) & vbNewLine

Else

MsgBox("There is no Creation date for the photo")

Exit Sub

End If

End Select

Catch

End Try

Next

MyText = Replace(MyText, Chr(0), "")

If MyText = "" Then

MyText = "No EXIF information with this image"

MsgBox(MyText)

Exit Sub

End If

'now write the date on the image

Dim g As System.Drawing. Graphics

g = Graphics.FromIm age(MyImage)

g.TextRender ingHint = Drawing.Text.Te xtRenderingHint .AntiAliasGridF it

Dim objFont As Font = New Font("Arial", 16, FontStyle.Bold,
GraphicsUnit .Pixel)

' Write out the text

g.DrawString(My Text, objFont, Brushes.Red, 3, MyImage.Height - 20)

Me.PictureBox1. Image = MyImage

Catch ex As Exception

MsgBox(ex.Messa ge.ToString)

End Try
"jeff" <jhersey at allnorth dottt comwrote in message
news:um***** *********@TK2MS FTNGP02.phx.gbl ...
>
how easy is it to add text to a tiff? and example would be nice for
those of us that do not find it that easy.
>
thanks
>
>
>
"William LaMartin" <la******@tampa bay.rr.comwrote in message
news:u9**** **********@TK2M SFTNGP04.phx.gb l...
>>I have added text to an image. It is fairly easy.
>>
>As to printing an image, I haven't tried it in VB. A Google search
>produces some examples, e.g.
>http://www.codeproject.com/useritems/PrintBasics.asp.
>>
>So possibly you could do a call to their software to clean up the
>file and then do your own text addition and printing.
>>
>>
>"Ben" <Be*@Newsgroups .microsoft.comw rote in message
>news:%2*** *************@T K2MSFTNGP04.phx .gbl...
>>Hi
>>>
>>We are looking for a component that offers that offers the below for
>>Tiff files:
>>>
>>Image clean-up (deskew, despeckle)
>>Printin g capabilities from VB
>>The ability to add text to image, e.g. time / date
>>>
>>Nice to have:
>>Image compression/optimisation.
>>The above for PDFs
>>>
>>Future options:
>>OCR capabilities
>>>
>>>
>>We have been looking at www.vintasoft.com/ which is excellently
>>priced at $50 US, but does not offer Printing / Addition of Text.
>>>
>>Other options we have looked at are well over $1000 dollars and
>>often requires expensive runtime licences.
>>>
>>Are there any low cost alternatives that do not sacrifice
>>functiona lity.
>>>
>>Thanks
>>B
>>>
>>
>>
>
>




Mar 7 '07 #8

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

Similar topics

2
4898
by: Robin Becker | last post by:
Has anyone done transparency with PIL & TIFF? I'm using PIL to generate a preview TIFF for embedding into an eps file and am being asked for the TIFF to support transparency. -- Robin Becker
17
10052
by: PyPK | last post by:
Hi I am looking for a simple tiff Image reader/writer in python.Can anyone point me to the right one.
3
5878
by: T. Davis | last post by:
In C#, I am able to successfully stream a TIFF image that comes from a BLOB field in a database, save it to file, then convert the pages within TIFF file into jpegs (using GDI+) and display on the web (using ASP.NET). However, when I generate the Image object using FromStream (passing in the MemoryStream containing image bytes), an exception of "A generic error occurred in GDI+" is thrown when performing the conversion/save for display....
2
3582
by: Al Reid | last post by:
Is it possible to display an image that is stored on the server as a TIFF image, on an ASP.Net page without the use of an add-in viewer? If so, could someone tell me how to do it? TIA -- Al Reid
6
10040
by: qysbc | last post by:
I have a web page and there is a link to open a TIFF file. The way I do it is to have the server code open a binary stream, set the content type to "image/tiff" and call Response.BinaryWrite. On the client machine, the file type TIFF is associated with Kodak Imaging Preview. This app works on most client machines. When you click on the link, Kodak Imaging Preview will open the TIFF file on the client machine. However, on some machines, the...
1
3006
by: amit gupta | last post by:
Hello, I am using QuarkXPress on Macintosh to generate EPS Files with Tiff Preview embedded in it. I have written some C code to extract Tiff Preview from EPS files generated which works pretty well. I want do some image manipulation on the extracted tiff images, for which I intend to use LibTiff on Macintosh. The problem right now I am facing is that LibTiff api TIFFOpen returns
3
6675
by: Andres Corrada-Emmanuel | last post by:
Hello, I have installed PIL 1.1.5 on Windows with Python 2.4. I'm unable to open .tiff images that I can open and view using Windows Explorer. In other words, this simple test fails: import Image im = Image.open('small.tif') with an 'cannot identify image file' error message. I'm able to open .jpg
5
15020
by: Sameer Gupta | last post by:
what are options for opening / handling tiff files in .Net framework ? which is the best library, namespace ? Please help Regards Sameer Gupta C# Designer & Developer Siemens UK
1
3459
by: Stedak | last post by:
I have the following class I use to save Tiff's. The problem I have with it is that the final size of the images are very large. If we scan directly to a file the final tiff may be 600-900 kb.s but with this code it is often 4000-5000 kb.s. What am I missing? public class EmrTiff : IDisposable { private string fileName; private ArrayList imageContainer = null;
0
2321
by: stuinstra35 | last post by:
I need help converting a PixelFormat.Format16bppRgb555 image to a PixelFormat.Format1bppIndexed image in VB.net The images I'm working with are all black and white documents. I create the original 16 bit image. Then I create a graphics handle to it so I can use it for drawing. I want the final output file to be just a 1 bit (2 color) tiff file because of the much smaller file size. Too bad VB.net doesn't let you create a Graphics handle to...
0
9827
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
10863
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10609
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
10263
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
6987
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5663
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...
0
5838
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4468
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
2
4034
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.