473,385 Members | 1,311 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 3738
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.comwrote in message
news:%2****************@TK2MSFTNGP04.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******@tampabay.rr.comwrote in message
news:u9**************@TK2MSFTNGP04.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.comwrote in message
news:%2****************@TK2MSFTNGP04.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.Encoding = System.Text.Encoding.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(OpenFileDialog1.FileName)

Dim AProp As System.Drawing.Imaging.PropertyItem

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

'and put them into the string s

For Each AProp In MyImage.PropertyItems

Try 'Some cameras are non-standard; hence TryCatch

Select Case AProp.Id.ToString("x")

Case "9003" 'Date

If Trim(encoding.GetString(AProp.Value)) <_

"" Then

MyText = encoding.GetString(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.FromImage(MyImage)

g.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFit

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

' Write out the text

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

Me.PictureBox1.Image = MyImage

Catch ex As Exception

MsgBox(ex.Message.ToString)

End Try
"jeff" <jhersey at allnorth dottt comwrote in message
news:um**************@TK2MSFTNGP02.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******@tampabay.rr.comwrote in message
news:u9**************@TK2MSFTNGP04.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.comwrote in message
news:%2****************@TK2MSFTNGP04.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******@tampabay.rr.comwrote in message
news:%2****************@TK2MSFTNGP05.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.Encoding = System.Text.Encoding.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(OpenFileDialog1.FileName)

Dim AProp As System.Drawing.Imaging.PropertyItem

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

'and put them into the string s

For Each AProp In MyImage.PropertyItems

Try 'Some cameras are non-standard; hence TryCatch

Select Case AProp.Id.ToString("x")

Case "9003" 'Date

If Trim(encoding.GetString(AProp.Value)) <_

"" Then

MyText = encoding.GetString(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.FromImage(MyImage)

g.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFit

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

' Write out the text

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

Me.PictureBox1.Image = MyImage

Catch ex As Exception

MsgBox(ex.Message.ToString)

End Try
"jeff" <jhersey at allnorth dottt comwrote in message
news:um**************@TK2MSFTNGP02.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******@tampabay.rr.comwrote in message
news:u9**************@TK2MSFTNGP04.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.comwrote in message
news:%2****************@TK2MSFTNGP04.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 #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(the 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**************@TK2MSFTNGP05.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******@tampabay.rr.comwrote in message
news:%2****************@TK2MSFTNGP05.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.Encoding = System.Text.Encoding.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(OpenFileDialog1.FileName)

Dim AProp As System.Drawing.Imaging.PropertyItem

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

'and put them into the string s

For Each AProp In MyImage.PropertyItems

Try 'Some cameras are non-standard; hence TryCatch

Select Case AProp.Id.ToString("x")

Case "9003" 'Date

If Trim(encoding.GetString(AProp.Value)) <_

"" Then

MyText = encoding.GetString(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.FromImage(MyImage)

g.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFit

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

' Write out the text

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

Me.PictureBox1.Image = MyImage

Catch ex As Exception

MsgBox(ex.Message.ToString)

End Try
"jeff" <jhersey at allnorth dottt comwrote in message
news:um**************@TK2MSFTNGP02.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******@tampabay.rr.comwrote in message
news:u9**************@TK2MSFTNGP04.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.comwrote in message
news:%2****************@TK2MSFTNGP04.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 #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******@tampabay.rr.comwrote in message
news:et**************@TK2MSFTNGP06.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(the 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**************@TK2MSFTNGP05.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******@tampabay.rr.comwrote in message
news:%2****************@TK2MSFTNGP05.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.Encoding = System.Text.Encoding.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(OpenFileDialog1.FileName)

Dim AProp As System.Drawing.Imaging.PropertyItem

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

'and put them into the string s

For Each AProp In MyImage.PropertyItems

Try 'Some cameras are non-standard; hence TryCatch

Select Case AProp.Id.ToString("x")

Case "9003" 'Date

If Trim(encoding.GetString(AProp.Value)) <_

"" Then

MyText = encoding.GetString(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.FromImage(MyImage)

g.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFit

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

' Write out the text

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

Me.PictureBox1.Image = MyImage

Catch ex As Exception

MsgBox(ex.Message.ToString)

End Try
"jeff" <jhersey at allnorth dottt comwrote in message
news:um**************@TK2MSFTNGP02.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******@tampabay.rr.comwrote in message
news:u9**************@TK2MSFTNGP04.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.comwrote in message
news:%2****************@TK2MSFTNGP04.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 #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**************@TK2MSFTNGP02.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******@tampabay.rr.comwrote in message
news:et**************@TK2MSFTNGP06.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(the 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**************@TK2MSFTNGP05.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******@tampabay.rr.comwrote in message
news:%2****************@TK2MSFTNGP05.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.Encoding = System.Text.Encoding.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(OpenFileDialog1.FileName)

Dim AProp As System.Drawing.Imaging.PropertyItem

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

'and put them into the string s

For Each AProp In MyImage.PropertyItems

Try 'Some cameras are non-standard; hence TryCatch

Select Case AProp.Id.ToString("x")

Case "9003" 'Date

If Trim(encoding.GetString(AProp.Value)) <_

"" Then

MyText = encoding.GetString(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.FromImage(MyImage)

g.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFit

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

' Write out the text

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

Me.PictureBox1.Image = MyImage

Catch ex As Exception

MsgBox(ex.Message.ToString)

End Try
"jeff" <jhersey at allnorth dottt comwrote in message
news:um**************@TK2MSFTNGP02.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******@tampabay.rr.comwrote in message
news:u9**************@TK2MSFTNGP04.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.comwrote in message
>news:%2****************@TK2MSFTNGP04.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 #8

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

Similar topics

2
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
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
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...
2
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...
6
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...
1
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...
3
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...
5
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
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...
0
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.