VintaSoft PDF .NET Plug-in Discussions
Questions, comments and suggestions concerning VintaSoft PDF .NET Plug-in.
Board index < VintaSoft Imaging < VintaSoft PDF .NET Plug-in Discussions
public class MyCommentVisualTool: CommentVisualTool
{
public MyCommentVisualTool(ImageViewerCommentController commentController, ICommentControlFactory commentControlFactory)
: base(commentController, commentControlFactory)
{
}
protected override void DrawCommentSourceDecorations(PaintEventArgs paintArgs, Comment comment, Rectangle commentSourceBoundingBox)
{
if (!string.IsNullOrEmpty(comment.Text))
{
SizeF size = new SizeF(10, 10);
PointF location = new PointF(
commentSourceBoundingBox.X + commentSourceBoundingBox.Width / 2 - size.Width / 2,
commentSourceBoundingBox.Y + commentSourceBoundingBox.Height / 2 - size.Height / 2);
paintArgs.Graphics.FillRectangle(Brushes.Yellow, new RectangleF(location, size));
}
}
}
For using MyCommentVisualTool class in PdfEditorDemo project please change line:
_commentTool = new CommentVisualTool(commentController, new CommentControlFactory());to the following line:
_commentTool = new MyCommentVisualTool(commentController, new CommentControlFactory());Best regards, Alexander