• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

Create Tiff File from String

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
PSERS
Asked:
PSERS
1 Solution
 
Luis PérezSoftware Architect in .NetCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now