This property holds a collection of all the IPTC elements that
were found. So if you want to write them out you might use the
following code:
[C#]
XImageLoadOptions loadOptions = new XImageLoadOptions();
loadOptions.ReadIPTC = true;
XImage image = XImage.FromFile(Server.MapPath("rez/iptc_info.tif"), loadOptions);
if (image.IPTC != null) {
foreach (IPTCRecord ip in image.IPTC) {
Response.Write("Record = " + ip.Record.ToString() + "<br>");
Response.Write("DataSet = " + ip.DataSet.ToString() + "<br>");
Response.Write("Name = " + ip.Name + "<br>");
Response.Write("Text = " + ip.Text + "<br>");
}
}
[Visual Basic]
Dim loadOptions As New XImageLoadOptions()
loadOptions.ReadIPTC = True
Dim image As XImage = XImage.FromFile(Server.MapPath("rez/iptc_info.tif"), loadOptions)
If image.IPTC IsNot Nothing Then
For Each ip As IPTCRecord In image.IPTC
Response.Write("Record = " & ip.Record.ToString() & "<br>")
Response.Write("DataSet = " & ip.DataSet.ToString() & "<br>")
Response.Write("Name = " & ip.Name & "<br>")
Response.Write("Text = " & ip.Text & "<br>")
Next
End If
This might produce the following output:
Record = 2
DataSet = 0
Name =
Text =
Record = 2
DataSet = 120
Name = Caption
Text = Boats in the harbor
Record = 2
DataSet = 80
Name = Byline
Text = Chris Wyatt
Record = 2
DataSet = 25
Name = Keyword
Text = boat
Record = 2
DataSet = 25
Name = Keyword
Text = sea
Record = 2
DataSet = 25
Name = Keyword
Text = sailing
Record = 2
DataSet = 116
Name = Copyright String
Text = Chris Wyatt 2001
|