本文整理汇总了C#中IImage.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IImage.ToString方法的具体用法?C# IImage.ToString怎么用?C# IImage.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IImage
的用法示例。
在下文中一共展示了IImage.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteImage
private void WriteImage(IImage image)
{
if (characterMarshal.HasMarshalled(image))
{
/* Been there, done that. */
return;
}
ImageBlob blob = image as ImageBlob;
if (blob == null)
{
throw new SWFModellerException(SWFModellerError.Internal, "Can't write " + image.ToString());
}
switch (blob.DataFormat)
{
case Tag.DefineBitsJPEG2:
case Tag.DefineBitsLossless:
case Tag.DefineBitsLossless2:
WriteBuffer blobBuffer = OpenTag(blob.DataFormat);
blobBuffer.WriteUI16((uint)characterMarshal.GetIDFor(image));
blobBuffer.WriteBytes(blob.FormattedBytes);
CloseTag();
break;
case Tag.DefineBits:
if (blob.JPEGTable != null)
{
if (writtenJPEGTable != null && writtenJPEGTable != blob.JPEGTable)
{
/* ISSUE 16 */
throw new SWFModellerException(SWFModellerError.UnimplementedFeature,
"Can't process multiple JPEG encoding tables yet.");
}
WriteBuffer tables = OpenTag(Tag.JPEGTables);
tables.WriteBytes(blob.JPEGTable.TableData);
CloseTag();
writtenJPEGTable = blob.JPEGTable;
}
WriteBuffer bits = OpenTag(Tag.DefineBits);
bits.WriteUI16((uint)characterMarshal.GetIDFor(image));
bits.WriteBytes(blob.FormattedBytes);
CloseTag();
break;
default:
throw new SWFModellerException(SWFModellerError.Internal, "Can't write image format " + blob.DataFormat.ToString());;
}
}