本文整理匯總了C#中PdfSharp.Pdf.PdfDictionary.IsImage方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfDictionary.IsImage方法的具體用法?C# PdfDictionary.IsImage怎麽用?C# PdfDictionary.IsImage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PdfSharp.Pdf.PdfDictionary
的用法示例。
在下文中一共展示了PdfDictionary.IsImage方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Initialize
/// <summary>
/// Initializes the item based on the specified PdfDictionary.
/// </summary>
/// <param name="dictionary">The dictionary to use for initialization.</param>
private void Initialize(PdfDictionary dictionary)
{
if (dictionary == null) throw new ArgumentNullException("dictionary", "The PDF dictionary item to extract image meta data from was null.");
if (!dictionary.IsImage()) throw new ArgumentException("The specified dictionary does not represent an image.", "dictionary");
Height = dictionary.Elements.GetInteger("/Height");
Width = dictionary.Elements.GetInteger("/Width");
BitsPerPixel = dictionary.Elements.GetInteger("/BitsPerComponent");
Length = dictionary.Elements.GetInteger("/Length");
PdfItem colorSpace = null;
if (dictionary.Elements.TryGetValue("/ColorSpace", out colorSpace)) {
ColorSpace = PdfDictionaryColorSpace.Parse(colorSpace);
}
else ColorSpace = new PdfRGBColorSpace(); // Default to RGB Color Space
}