LEADTOOLS Support
Document
Document SDK Questions
i wnat to show outline by AnnPen Object and picture by AnnPicture Object at the same time onAnnStamp
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Sunday, September 4, 2011 8:34:03 AM(UTC)
Groups: Registered
Posts: 1
AnnPicture pic = new AnnPicture(img);
AnnStampObject annImg = new AnnStampObject();
annImg.Pen = new AnnPen(this.OUTLINE_DEFAULT_COLOR, new AnnLength(OUTLINE_DEFAULT_WIDTH));
annImg.Bounds = new AnnRectangle(x, y, widthF, heightF);
annImg.Picture = pic;
is it possible?
if it is not possible, i want to know how do i?
is it possible by Custom annotation?
------------------------------
.net framework 4.0 , c#
leadtools 17.5 & window form
#2
Posted
:
Monday, September 5, 2011 5:21:16 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
You can do this by creating an AnnRectangleObject object (represents the outline) and an AnnStampObject (contains the image), and then add the two objects to an AnnGroupObject and add the group object to the annotation Container. The following code does this:
+----------+
//Create annotation rectangle object
AnnRectangleObject rect = new AnnRectangleObject();
rect.Pen = new AnnPen(Color.Red, new AnnLength(1, AnnUnit.Pixel));
rect.Brush = new AnnSolidBrush(Color.Red);
rect.Bounds = new AnnRectangle(90, 190, 420, 620, AnnUnit.Pixel);
//Create annotation stamp object
AnnStampObject stamp = new AnnStampObject();
AnnPicture pic = new AnnPicture(Image.FromFile(@"C:\LEADTOOLS Images\cannon.jpg"));
pic.TransparentMode = AnnPictureTransparentMode.None;
pic.TransparentColor = Color.Black;
stamp.Picture = pic;
stamp.Pen = new AnnPen(Color.Red,new AnnLength(3,AnnUnit.Pixel));
stamp.LineAlignment = StringAlignment.Center;
stamp.Text = "LEADTOOLS";
stamp.Bounds = new AnnRectangle(100, 200, 400, 600, AnnUnit.Pixel);
//create a group object
AnnGroupObject group = new AnnGroupObject();
group.Objects.Add(rect);
group.Objects.Add(stamp);
//Add the group object to the annotation container
AutomationAnn.Container.Objects.Add(group);
+----------+
Thanks,
Maen Badwan
LEADTOOLS Technical Support
LEADTOOLS Support
Document
Document SDK Questions
i wnat to show outline by AnnPen Object and picture by AnnPicture Object at the same time onAnnStamp
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.