This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Sunday, November 27, 2005 4:31:52 PM(UTC)
Groups: Registered
Posts: 2
I want to add some text on the image,for example this image:
How can I do?
Shingo Yabuki attached the following image(s):
#2
Posted
:
Monday, December 5, 2005 1:38:03 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
What is the programming interface (COM, OCX, API, .Net, etc.) that you are using?
What is the programming language that you are using?
However, if you are using COM
programming interface with VB, you can draw text on the image by using
the DrawText method (ILEADRasterFXD) as shown below follows:
+---------------------------------+
Dim LeadRasIO As New LEADRasterIO
Dim RasterFxd As New LEADRasterFXD
...
LeadRasIO.Load LEADRasterView2.Raster, "d:\lead14\dist\images\ulay1.bmp", 0, 0, 1
'Set the text properties
RasterFxd.TextTop = 50
RasterFxd.TextLeft = 50
RasterFxd.TextWidth = LEADRasterView1.DstWidth - 50
RasterFxd.TextHeight = LEADRasterView1.DstHeight - 50
RasterFxd.TextAlign = FXD_TEXTALIGN_HCENTER_VCENTER
RasterFxd.TextAngle = 450 '45 degrees
'Text highlight color and style
RasterFxd.TextHiliteColor = RGB(0, 0, 0)
RasterFxd.TextStyle = FXD_TEXTSTYLE_DROPSHADOW
'Draw the text
RasterFxd.DrawText LEADRasterView1.Raster, 0, "LEADTOOLS", LEADRasterView1.Raster.Bitmap
...
+---------------------------------+
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#3
Posted
:
Tuesday, December 6, 2005 3:40:57 PM(UTC)
Groups: Registered
Posts: 11
Hi Maen,
How would we go about doing something like that with .NET and LEADTools Document Imaging v14?
#4
Posted
:
Sunday, December 11, 2005 4:56:26 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hi Mike,
You can draw text (string) using LEADTOOLS .Net SDK by using the following code:
+-----------------------------------------+
using System.Drawing;
using System.Drawing.Drawing2D;
...
private void button2_Click(object sender, System.EventArgs e)
{
RasterImageGdiPlusGraphicsContainer container = rasterImageViewer1.Image.CreateGdiPlusGraphics();
container.Graphics.SmoothingMode = SmoothingMode.HighQuality;
Brush br = new LinearGradientBrush(Point.Empty, new Point(200, 200), Color.Red, Color.Yellow);
Font font1 = new Font(FontFamily.GenericSansSerif,12);
PointF point1 = new PointF(100,100);
container.Graphics.DrawString("LEADTOOLS",font1,br,point1);
rasterImageViewer1.Refresh();
}
+-----------------------------------------+
Thanks,
Maen Badwan
LEADTOOLS Technical Support
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.