Here is an example for WinForms that shows how to create the stamp annotation with disabled text editing:
Code: Select all
using System;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
// add image to the viewer
annotationViewer1.Images.Add("320155_1886.jpg");
// create the stamp annotation data
Vintasoft.Imaging.Annotation.StampAnnotationData stampAnnotationData = new Vintasoft.Imaging.Annotation.StampAnnotationData();
// set the annotation text
stampAnnotationData.Text = "Approved!";
// create the stamp annotation view
Vintasoft.Imaging.Annotation.UI.StampAnnotationView stampAnnotationView = new Vintasoft.Imaging.Annotation.UI.StampAnnotationView(stampAnnotationData);
// change the Vintasoft.Imaging.Annotation.UI.VisualTools.UserInteraction.RectangularTextAnnotationTransformer to
// the Vintasoft.Imaging.Annotation.UI.VisualTools.UserInteraction.RectangularAnnotationTransformer -
// new transformer will not show text box when mouse is double cliked on annotation
stampAnnotationView.Transformer = new Vintasoft.Imaging.Annotation.UI.VisualTools.UserInteraction.RectangularAnnotationTransformer(stampAnnotationView);
// add annotation to the image in viewer and build the annotation
annotationViewer1.AddAndBuildAnnotation(stampAnnotationView);
}
}
}