TagGetID Method (GdViewer)
In This Topic
Returns a unique tag ID (a proper tag name defined by the specification) of the required tag, that is embedded within the document displayed in the GdViewer control.
Syntax
'Declaration
Public Function TagGetID( _
ByVal As Integer _
) As Tags
public Tags TagGetID(
int
)
public function TagGetID(
: Integer
): Tags;
public function TagGetID(
: int
) : Tags;
public: Tags TagGetID(
int
)
public:
Tags TagGetID(
int
)
Parameters
- TagNo
- The sequence index of the required tag within the displayed document. It must be a value from 1 to TagCount.
Return Value
A member of the Tags enumeration. The
GetStat method can be subsequently used to determine if this method has been successful.
Example
How to find out the tag's ID (a unique predefined tag name).
'We assume that the GdViewer1 control has been properly integrated
'and your document has been properly displayed as well.
Dim count As Integer = GdViewer1.TagCount()
If GdViewer1.GetStat() = GdPictureStatus.OK Then
Dim message As String = "Tags count: " + count + vbCrLf
Dim tagID As Tags = Tags.TagUnknown
Dim tagName As String = "", tagValue As String = ""
For i As Integer = 1 To count
tagID = GdViewer1.TagGetID(i)
If GdViewer1.GetStat() = GdPictureStatus.OK Then tagName = GdViewer1.TagGetName(i)
If GdViewer1.GetStat() = GdPictureStatus.OK Then tagValue = GdViewer1.TagGetValueString(i)
If GdViewer1.GetStat() = GdPictureStatus.OK Then
message = message + vbCrLf + tagName + " (" + tagID + "): " + tagValue
Else
message = message + vbCrLf + "Tag nr." + i + " Status: " + GdViewer1.GetStat().ToString()
End If
Next
MessageBox.Show(message, "GdViewer.TagGetID")
Else
MessageBox.Show("The number of tags can't be found. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.TagGetID")
End If
//We assume that the GdViewer1 control has been properly integrated
//and your document has been properly displayed as well.
int count = GdViewer1.TagCount();
if (GdViewer1.GetStat() == GdPictureStatus.OK)
{
string message = "Tags count: " + count + "\n";
Tags tagID = Tags.TagUnknown;
string tagName = "", tagValue = "";
for (int i = 1; i <= count; i++)
{
tagID = GdViewer1.TagGetID(i);
if (GdViewer1.GetStat() == GdPictureStatus.OK)
tagName = GdViewer1.TagGetName(i);
if (GdViewer1.GetStat() == GdPictureStatus.OK)
tagValue = GdViewer1.TagGetValueString(i);
if (GdViewer1.GetStat() == GdPictureStatus.OK)
message = message + "\n" + tagName + " (" + tagID + "): " + tagValue;
else
message = message + "\nTag nr." + i + " Status: " + GdViewer1.GetStat().ToString();
}
MessageBox.Show(message, "GdViewer.TagGetID");
}
else
MessageBox.Show("The number of tags can't be found. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.TagGetID");
Example
How to find out the tag's ID (a unique predefined tag name).
'We assume that the GdViewer1 control has been properly integrated
'and your document has been properly displayed as well.
Dim count As Integer = GdViewer1.TagCount()
If GdViewer1.GetStat() = GdPictureStatus.OK Then
Dim message As String = "Tags count: " + count + vbCrLf
Dim tagID As Tags = Tags.TagUnknown
Dim tagName As String = "", tagValue As String = ""
For i As Integer = 1 To count
tagID = GdViewer1.TagGetID(i)
If GdViewer1.GetStat() = GdPictureStatus.OK Then tagName = GdViewer1.TagGetName(i)
If GdViewer1.GetStat() = GdPictureStatus.OK Then tagValue = GdViewer1.TagGetValueString(i)
If GdViewer1.GetStat() = GdPictureStatus.OK Then
message = message + vbCrLf + tagName + " (" + tagID + "): " + tagValue
Else
message = message + vbCrLf + "Tag nr." + i + " Status: " + GdViewer1.GetStat().ToString()
End If
Next
MessageBox.Show(message, "GdViewer.TagGetID")
Else
MessageBox.Show("The number of tags can't be found. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.TagGetID")
End If
//We assume that the GdViewer1 control has been properly integrated
//and your document has been properly displayed as well.
int count = GdViewer1.TagCount();
if (GdViewer1.GetStat() == GdPictureStatus.OK)
{
string message = "Tags count: " + count + "\n";
Tags tagID = Tags.TagUnknown;
string tagName = "", tagValue = "";
for (int i = 1; i <= count; i++)
{
tagID = GdViewer1.TagGetID(i);
if (GdViewer1.GetStat() == GdPictureStatus.OK)
tagName = GdViewer1.TagGetName(i);
if (GdViewer1.GetStat() == GdPictureStatus.OK)
tagValue = GdViewer1.TagGetValueString(i);
if (GdViewer1.GetStat() == GdPictureStatus.OK)
message = message + "\n" + tagName + " (" + tagID + "): " + tagValue;
else
message = message + "\nTag nr." + i + " Status: " + GdViewer1.GetStat().ToString();
}
MessageBox.Show(message, "GdViewer.TagGetID");
}
else
MessageBox.Show("The number of tags can't be found. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.TagGetID");
See Also