?
Solved

Create Tiff File from String

Posted on 2008-11-18
1
Medium Priority
?
194 Views
Last Modified: 2013-11-27
I need to create a tiff file from a string.   I was give the following code but i receive a run time error when i try to execute it.   I am using vb.net 2005.

 Dim newBitMap As New Bitmap("C:\mergeddocs\test.tif")
                        Dim Grp As Graphics = Graphics.FromImage(newBitMap)
                        Grp.DrawString("Hi world", Me.Font, Brushes.Black, 2, 2)
                        newBitMap.Save("C:\mergeddocs\test1.tif")
                        Grp.Dispose()
I get parameter is not valid on the first dim statement.   Can anyone help or give another simple example that would create a tiff from a string file  

thanks
ron
0
Comment
Question by:PSERS
1 Comment
 
LVL 25

Accepted Solution

by:
Luis Pérez earned 500 total points
ID: 22984328
Dim newBitMap As New Bitmap(desiredWidth, desiredHeight)
                        Dim Grp As Graphics = Graphics.FromImage(newBitMap)
                        Grp.DrawString("Hi world", Me.Font, Brushes.Black, 2, 2)
                        Grp.Dispose()
                        newBitMap.Save("C:\mergeddocs\test1.tif")
                        newBitMap.Dispose()
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question