The sequence index of the required tag within the displayed document. It must be a value from 1 to IPTCCount.
Example





In This Topic

IPTCGetID Method (GdViewer)

In This Topic
Returns a unique IPTC tag ID (a proper IPTC 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 IPTCGetID( _
   ByVal TagNo As Integer _
) As IPTCTags
public IPTCTags IPTCGetID( 
   int TagNo
)
public function IPTCGetID( 
    TagNo: Integer
): IPTCTags; 
public function IPTCGetID( 
   TagNo : int
) : IPTCTags;
public: IPTCTags IPTCGetID( 
   int TagNo
) 
public:
IPTCTags IPTCGetID( 
   int TagNo
) 

Parameters

TagNo
The sequence index of the required tag within the displayed document. It must be a value from 1 to IPTCCount.

Return Value

A member of the IPTCTags enumeration. The GetStat method can be subsequently used to determine if this method has been successful.
Remarks
It is recommend to use the GetStat method to identify the specific reason for the method's failure, if any.

Be aware that this method only handles IPTC tags.

Example
How to find out the IPTC tag's ID (a unique predefined IPTC 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.IPTCCount()
If GdViewer1.GetStat() = GdPictureStatus.OK Then
    Dim message As String = "IPTC Tags count: " + count + vbCrLf
    Dim tagID As IPTCTags = IPTCTags.IPTCTagUnknown
    Dim tagValue As String = ""
    For i As Integer = 1 To count
        tagID = GdViewer1.IPTCGetID(i)
        If GdViewer1.GetStat() = GdPictureStatus.OK Then
            tagValue = GdViewer1.TagGetValueString(i)
        End If
        If GdViewer1.GetStat() = GdPictureStatus.OK Then
            message = message + vbCrLf + tagID + ": " + tagValue
        Else
            message = message + vbCrLf + "Tag nr." + i + "  Status: " + GdViewer1.GetStat().ToString()
        End If
    Next
    MessageBox.Show(message, "GdViewer.IPTCGetID")
Else
    MessageBox.Show("The number of IPTC tags can't be found. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.IPTCGetID")
End If
//We assume that the GdViewer1 control has been properly integrated.
//and your document has been properly displayed as well.
int count = GdViewer1.IPTCCount();
if (GdViewer1.GetStat() == GdPictureStatus.OK)
{
    string message = "IPTC Tags count: " + count + "\n";
    IPTCTags tagID = IPTCTags.IPTCTagUnknown;
    string tagValue = "";
    for (int i = 1; i <= count; i++)
    {
        tagID = GdViewer1.IPTCGetID(i);
        if (GdViewer1.GetStat() == GdPictureStatus.OK)
            tagValue = GdViewer1.TagGetValueString(i);
        if (GdViewer1.GetStat() == GdPictureStatus.OK)
            message = message + "\n" + tagID + ": " + tagValue;
        else
            message = message + "\nTag nr." + i + "  Status: " + GdViewer1.GetStat().ToString();
    }
    MessageBox.Show(message, "GdViewer.IPTCGetID");
}
else
    MessageBox.Show("The number of IPTC tags can't be found. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.IPTCGetID");
See Also