How to extract XpsImageType from XpsImage?

How do you extract an XpsImageType enumeration from an XpsImage object instance to determine if an image resource is either JpegImageType (JPEG), PngImageType (PNG), TiffImageType (TIFF) or WdpImageType (WDP).

I've looked through the SDK and it appears the process is only one way, i.e. you can create an XpsImage object using the XpsImageType enumeration but not determine the type of an existing XpsImage object. Given an XpsImage object e.g. by reading from a IXPSFixedPageReader interface via the GetResource(uri) method, you cannot seem to determine what the image type is (other than parsing the raw image data).

Is there anyway of getting this information?

[689 byte] By [CraigGraw] at [2007-12-23]
# 1

Create the IPartImage with the help of the Image Uri and then use GetImageProperties() to retrieve the image content type.

I hope this solves ur problem.

KarthikeyanMahadevan at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,XML Paper Specification (XPS)...

Software Development for Windows Vista

Site Classified