473,406 Members | 2,956 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,406 software developers and data experts.

Creating and writing to a TIF file, how?

I need to create a tif file and write some simple text to it, about 4 or 5
lines, Just some thing like
"Hello this is mycompany"
"We will make a delivery between tomorrow 10 AM and tomorrow 10 PM"
I just want this to be in a fairly large font and centered, say in 14 point
Arial.

I've been googling for the last few days and find lots of stuff on Tif files
but nothing simple that seems to help me.

Can anyone point me to some sample code for doing the above?

Thanks for any help,

Bob
Feb 28 '07 #1
9 4028
On Feb 28, 12:43 pm, "Robert Dufour" <bduf...@sgiims.comwrote:
I need to create a tif file and write some simple text to it, about 4 or 5
lines, Just some thing like
"Hello this is mycompany"
"We will make a delivery between tomorrow 10 AM and tomorrow 10 PM"
I just want this to be in a fairly large font and centered, say in 14 point
Arial.

I've been googling for the last few days and find lots of stuff on Tif files
but nothing simple that seems to help me.

Can anyone point me to some sample code for doing the above?

Thanks for any help,

Bob
Hmm... TIFFs aren't simple! ;) Does it HAVE to be a TIFF? have you
considered other formats that might be easier to write to?

Feb 28 '07 #2
"Robert Dufour" <bd*****@sgiims.comschrieb:
>I need to create a tif file and write some simple text to it, about 4 or 5
lines, Just some thing like
"Hello this is mycompany"
"We will make a delivery between tomorrow 10 AM and tomorrow 10 PM"
I just want this to be in a fairly large font and centered, say in 14
point Arial.
Check out the 'System.Drawing' namespace, namely the 'Bitmap' and 'Graphics'
classes.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Feb 28 '07 #3
I would agree...

RTF might do a better job for you.

<lo*********@gmail.comwrote in message
news:11**********************@h3g2000cwc.googlegro ups.com...
On Feb 28, 12:43 pm, "Robert Dufour" <bduf...@sgiims.comwrote:
>I need to create a tif file and write some simple text to it, about 4 or
5
lines, Just some thing like
"Hello this is mycompany"
"We will make a delivery between tomorrow 10 AM and tomorrow 10 PM"
I just want this to be in a fairly large font and centered, say in 14
point
Arial.

I've been googling for the last few days and find lots of stuff on Tif
files
but nothing simple that seems to help me.

Can anyone point me to some sample code for doing the above?

Thanks for any help,

Bob

Hmm... TIFFs aren't simple! ;) Does it HAVE to be a TIFF? have you
considered other formats that might be easier to write to?

Feb 28 '07 #4
I have to end up with a Tif file, because I have to send it out as a fax and
the dialogic fax card I'm using only accepts txt and tif files.
I can send a txt file but the text is too small and the dialogic drivers
don't recognize embeddable tags for different font sizes. They only accept
pitch ar 10 or 17 char per inch. I could write to a PDF file (I have the C1
pdf component) and then convert it to tif with a converter to end up with a
Tif, but I would need to find a free or very unexpensive converter that I
can call from within code.
This is in a server app that runs unattended, so all the file converters
that I saw can't really be used, they all expect user interaction.

I need something that I can do automatically in code.

Bob


"Miro" <mi******@golden.netwrote in message
news:Oe**************@TK2MSFTNGP03.phx.gbl...
>I would agree...

RTF might do a better job for you.

<lo*********@gmail.comwrote in message
news:11**********************@h3g2000cwc.googlegro ups.com...
>On Feb 28, 12:43 pm, "Robert Dufour" <bduf...@sgiims.comwrote:
>>I need to create a tif file and write some simple text to it, about 4 or
5
lines, Just some thing like
"Hello this is mycompany"
"We will make a delivery between tomorrow 10 AM and tomorrow 10 PM"
I just want this to be in a fairly large font and centered, say in 14
point
Arial.

I've been googling for the last few days and find lots of stuff on Tif
files
but nothing simple that seems to help me.

Can anyone point me to some sample code for doing the above?

Thanks for any help,

Bob

Hmm... TIFFs aren't simple! ;) Does it HAVE to be a TIFF? have you
considered other formats that might be easier to write to?


Feb 28 '07 #5
not a spam but a google search came up with this library for TIFF

never used it but you might try it.

http://www.bartdart.com/
Lloyd Sheen

"Robert Dufour" <bd*****@sgiims.comwrote in message
news:eg**************@TK2MSFTNGP03.phx.gbl...
>I have to end up with a Tif file, because I have to send it out as a fax
and the dialogic fax card I'm using only accepts txt and tif files.
I can send a txt file but the text is too small and the dialogic drivers
don't recognize embeddable tags for different font sizes. They only accept
pitch ar 10 or 17 char per inch. I could write to a PDF file (I have the
C1 pdf component) and then convert it to tif with a converter to end up
with a Tif, but I would need to find a free or very unexpensive converter
that I can call from within code.
This is in a server app that runs unattended, so all the file converters
that I saw can't really be used, they all expect user interaction.

I need something that I can do automatically in code.

Bob


"Miro" <mi******@golden.netwrote in message
news:Oe**************@TK2MSFTNGP03.phx.gbl...
>>I would agree...

RTF might do a better job for you.

<lo*********@gmail.comwrote in message
news:11**********************@h3g2000cwc.googlegr oups.com...
>>On Feb 28, 12:43 pm, "Robert Dufour" <bduf...@sgiims.comwrote:
I need to create a tif file and write some simple text to it, about 4
or 5
lines, Just some thing like
"Hello this is mycompany"
"We will make a delivery between tomorrow 10 AM and tomorrow 10 PM"
I just want this to be in a fairly large font and centered, say in 14
point
Arial.

I've been googling for the last few days and find lots of stuff on Tif
files
but nothing simple that seems to help me.

Can anyone point me to some sample code for doing the above?

Thanks for any help,

Bob

Hmm... TIFFs aren't simple! ;) Does it HAVE to be a TIFF? have you
considered other formats that might be easier to write to?


Feb 28 '07 #6
Thanks, I looked at that but it all seems to be conversions stuff, nothing
in it seems to allow one to create a tiff file from scratch. Maybe there is
but I could not see how.
Thanks,
Bob
"Lloyd Sheen" <a@b.cwrote in message
news:97**********************************@microsof t.com...
not a spam but a google search came up with this library for TIFF

never used it but you might try it.

http://www.bartdart.com/
Lloyd Sheen

"Robert Dufour" <bd*****@sgiims.comwrote in message
news:eg**************@TK2MSFTNGP03.phx.gbl...
>>I have to end up with a Tif file, because I have to send it out as a fax
and the dialogic fax card I'm using only accepts txt and tif files.
I can send a txt file but the text is too small and the dialogic drivers
don't recognize embeddable tags for different font sizes. They only
accept pitch ar 10 or 17 char per inch. I could write to a PDF file (I
have the C1 pdf component) and then convert it to tif with a converter to
end up with a Tif, but I would need to find a free or very unexpensive
converter that I can call from within code.
This is in a server app that runs unattended, so all the file converters
that I saw can't really be used, they all expect user interaction.

I need something that I can do automatically in code.

Bob


"Miro" <mi******@golden.netwrote in message
news:Oe**************@TK2MSFTNGP03.phx.gbl...
>>>I would agree...

RTF might do a better job for you.

<lo*********@gmail.comwrote in message
news:11**********************@h3g2000cwc.googleg roups.com...
On Feb 28, 12:43 pm, "Robert Dufour" <bduf...@sgiims.comwrote:
I need to create a tif file and write some simple text to it, about 4
or 5
lines, Just some thing like
"Hello this is mycompany"
"We will make a delivery between tomorrow 10 AM and tomorrow 10 PM"
I just want this to be in a fairly large font and centered, say in 14
point
Arial.
>
I've been googling for the last few days and find lots of stuff on Tif
files
but nothing simple that seems to help me.
>
Can anyone point me to some sample code for doing the above?
>
Thanks for any help,
>
Bob

Hmm... TIFFs aren't simple! ;) Does it HAVE to be a TIFF? have you
considered other formats that might be easier to write to?


Feb 28 '07 #7
On Feb 28, 12:43 pm, "Robert Dufour" <bduf...@sgiims.comwrote:
I need to create a tif file and write some simple text to it, about 4 or 5
lines, Just some thing like
"Hello this is mycompany"
"We will make a delivery between tomorrow 10 AM and tomorrow 10 PM"
I just want this to be in a fairly large font and centered, say in 14 point
Arial.

I've been googling for the last few days and find lots of stuff on Tif files
but nothing simple that seems to help me.

Can anyone point me to some sample code for doing the above?

Thanks for any help,

Bob
Bob:
You could try the LeadTools ocx.
http://www.leadtools.com/
It's not difficult to use.
Regards,
ImageAnalyst
Mar 1 '07 #8
Addendum:

Code sample:

Editing multi frame .Tiff file
<URL:http://www.codeproject.com/vb/net/faxeditor.asp>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Mar 2 '07 #9
Here is some code to get you started. It will turn one line of text into a
Tif file. If you want more than one line you will have to add to it.

Dim MyFont As New Drawing.Font("Arial", 15, FontStyle.Regular)
Dim tempbmp As New Drawing.Bitmap(1, 1,
Drawing.Imaging.PixelFormat.Format24bppRgb) 'just to get the size of the
text string
Dim tempGraphic As Drawing.Graphics =
Drawing.Graphics.FromImage(tempbmp)
Dim TextSize As Drawing.SizeF
TextSize = tempGraphic.MeasureString(Me.txtMessage.Text, MyFont)
Dim MyBitmap As New Drawing.Bitmap(TextSize.Width, TextSize.Height,
Drawing.Imaging.PixelFormat.Format24bppRgb)
Dim MyGraphic As Drawing.Graphics =
Drawing.Graphics.FromImage(MyBitmap)
MyGraphic.Clear(System.Drawing.Color.White)
MyGraphic.DrawString(Me.txtMessage.Text, MyFont, New
Drawing.SolidBrush(Drawing.Color.Black), 0, 0)
MyBitmap.Save("C:\temp\texttographic.tif",
System.Drawing.Imaging.ImageFormat.Tiff)

"Robert Dufour" <bd*****@sgiims.comwrote in message
news:Ol**************@TK2MSFTNGP04.phx.gbl...
>I need to create a tif file and write some simple text to it, about 4 or 5
lines, Just some thing like
"Hello this is mycompany"
"We will make a delivery between tomorrow 10 AM and tomorrow 10 PM"
I just want this to be in a fairly large font and centered, say in 14
point Arial.

I've been googling for the last few days and find lots of stuff on Tif
files but nothing simple that seems to help me.

Can anyone point me to some sample code for doing the above?

Thanks for any help,

Bob


Mar 2 '07 #10

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

Similar topics

3
by: Pjotr Wedersteers | last post by:
Hi, I am rather new to PHP and a relative newbie to Linux too. I have a webserver at home (Apache 2.0.48 on SuSe 9.0, PHP4). I have some scripts, one of them needs to be able to create logfiles...
3
by: AJ | last post by:
Hello, I was wondering if it is possible to create a file if it doean't exist. I am using fstream and writing in and out a binary file. I check to see if the file is opened. if it doesn't get...
10
by: draghuram | last post by:
Hi, Is there any special support for sparse file handling in python? My initial search didn't bring up much (not a thorough search). I wrote the following pice of code: options.size =...
2
by: George Marsaglia | last post by:
I have a set of, say, 2000 points in the 8-dimensional simplex S={(x_1,x_2,...,x_8),x_1+x_2+...+x_8=1, x's>=0}. To help analyze that 8-dimensional set, I wish to project the set of points onto...
12
by: Mark | last post by:
Hello, in a simple console application I try to create a file with some code like: FileStream file = new FileStream("test.txt", FileMode.OpenOrCreate, FileAccess.Write); StreamWriter sw = new...
1
by: ROO | last post by:
Hi Everyone, I need some help Creating Database Connection at runtime and writing Connection String to App.Config, I have 3mxtboxes on a form txtUsername = SQL admin User txtPassword = Sql admin...
12
by: Mats Lycken | last post by:
Hi, I'm creating a CMS that I would like to be plug-in based with different plugins handling different kinds of content. What I really want is to be able to load/unload plugins on the fly without...
2
by: asad | last post by:
hello, how ru all pls tell me how can i create DAL and how can i use it in my ASP.NET pages thanks
0
by: mcc99 | last post by:
Amazing, I surfed around to find a simple utility that could list files recursively from a given top folder down through it, writing out the path and filename in simple \path\file_name form, without...
13
by: jkimbler | last post by:
As part of our QA of hardware and firmware for the company I work for, we need to automate some testing of devices and firmware. Since not everybody here knows C#, I'm looking to create a new...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
0
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,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...
0
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,...

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.