AddEmbeddedImageAnnotInteractive(String,Boolean,Color,Single,Single) Method
Allows users to interactively add a new embedded image annotation using the mouse on the current page of the document displayed in the GdViewer control. The annotation object is added following all the parameters you have specified and respecting the dimensions users will define using the mouse as well.
This annotation enables users to embed a specified image on the page using its file path.
The type of the newly added annotation object is GdPictureAnnotationType.AnnotationTypeEmbeddedImage. You can change the annotation properties directly using the GdPicture14.Annotations.AnnotationEmbeddedImage class before or after the successful creation of the annotation object. Please refer to both the GdViewer.BeforeAnnotationAddedByUser and the GdViewer.AnnotationAddedByUser events for how to achieve this.
Be aware that the editing mode for annotations must be enabled using the GdViewer.SetAnnotationEditorMode method, otherwise this method will fail.
public void AddEmbeddedImageAnnotInteractive(
string ,
bool ,
Color ,
float ,
float
)
public procedure AddEmbeddedImageAnnotInteractive(
: String;
: Boolean;
: Color;
: Single;
: Single
);
public function AddEmbeddedImageAnnotInteractive(
: String,
: boolean,
: Color,
: float,
: float
);
public: void AddEmbeddedImageAnnotInteractive(
string* ,
bool ,
Color ,
float ,
float
)
public:
void AddEmbeddedImageAnnotInteractive(
String^ ,
bool ,
Color ,
float ,
float
)
'Declaration
Public Overloads Sub AddEmbeddedImageAnnotInteractive( _
ByVal As String, _
ByVal As Boolean, _
ByVal As Color, _
ByVal As Single, _
ByVal As Single _
)
Parameters
- ImagePath
- The file path of the image resource to render as an annotation. Use the empty string to allow the control to prompt users to select a file.
You can subsequently use the GdViewer.GetLastPath method to retrieve the path of the selected file.
- Stroke
- Set this parameter to true, if you want to stroke the embedded image using the defined border color, otherwise set it to false.
- BorderColor
- A color object that defines the required border color of the newly added embedded image annotation.
It is the color of the border drawn around the embedded image if you set the Stroke parameter to true.
- BorderWidth
- The border width of the newly added embedded image annotation, in inches.
It is the width of the colored border drawn around the embedded image if you set the Stroke parameter to true.
- Opacity
- The opacity value of the newly added embedded image annotation, from 0 (full transparency) to 1 (full opacity).
How to allow users to interactively add an embedded image annotation on the currently displayed page.
'We assume that the GdViewer1 control has been properly integrated.
Sub buttonAddImageAnnot_Click(ByVal sender As Object, ByVal e As EventArgs)
GdViewer1.AddEmbeddedImageAnnotInteractive("", False, Color.Empty, 0, 1)
If GdViewer1.GetStat() <> GdPictureStatus.OK Then MessageBox.Show("Error! Status: " + GdViewer1.GetStat().ToString(), "AddEmbeddedImageAnnotInteractive")
End Sub
//We assume that the GdViewer1 control has been properly integrated.
void buttonAddImageAnnot_Click(object sender, EventArgs e)
{
GdViewer1.AddEmbeddedImageAnnotInteractive("", false, Color.Empty, 0, 1);
if (GdViewer1.GetStat() != GdPictureStatus.OK) MessageBox.Show("Error! Status: " + GdViewer1.GetStat().ToString(), "AddEmbeddedImageAnnotInteractive");
}