Skip to content

Text on the Image

kalit sikka

Asked Apr 25, 2007, 2:55 AM EDT2 answers
Share
LinkedInX
Hi, can anybody guide me how to write text on tiff images. Thanks in Advance kalit

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Mike Gold
    0

    you could load the image into a graphics device, then use graphics.DrawString(),  then save the image back out.

    example:

    Java
    Image img = Image.FromFile(@"c:\chocolate bar.tiff");
    Graphics g = Graphics.FromImage(img);
    g.DrawString("Willy Wonka", this.Font, Brushes.Black, new PointF(0f, 5f));
    img.Save(@"c:\chocolate bar1.tiff", ImageFormat.Tiff);
    0
  • 0
    Following Error come on Graphics g = Graphics.FromImage(img); A Graphics object cannot be created from an image that has an indexed pixel format. This is coming only is case of Tiff format, if same image is converted in jpg format than its running fine. Please help me on this.
    0