[C#]
XImageLoadOptions loadOptions = new XImageLoadOptions();
loadOptions.ReadIPTC = true;
XImage image = XImage.FromFile(Server.MapPath("rez/ipct2.jpg"), loadOptions);
if (image.IPTC != null) {
Response.Write(image.IPTC["Headline"].Text);
Response.Write("<br>");
Response.Write(image.IPTC["Caption"].Text);
Response.Write("<br>");
}
[Visual Basic]
Dim loadOptions As New XImageLoadOptions()
loadOptions.ReadIPTC = True
Dim image As XImage = XImage.FromFile(Server.MapPath("rez/ipct2.jpg"), loadOptions)
If image.IPTC IsNot Nothing Then
Response.Write(image.IPTC("Headline").Text)
Response.Write("<br>")
Response.Write(image.IPTC("Caption").Text)
Response.Write("<br>")
End If
This example writes the Headline and Caption from a TIFF file.
An error will be raised if the IPTC data does not contain a
headline and caption.
|