本文整理匯總了C#中OpenMetaverse.Imaging.ManagedImage.ExportTGA方法的典型用法代碼示例。如果您正苦於以下問題:C# ManagedImage.ExportTGA方法的具體用法?C# ManagedImage.ExportTGA怎麽用?C# ManagedImage.ExportTGA使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OpenMetaverse.Imaging.ManagedImage
的用法示例。
在下文中一共展示了ManagedImage.ExportTGA方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DecodeToImage
/// <summary>
/// Decode JPEG2000 data to an <seealso cref="System.Drawing.Image"/> and
/// <seealso cref="ManagedImage"/>
/// </summary>
/// <param name="encoded">JPEG2000 encoded data</param>
/// <param name="managedImage">ManagedImage object to decode to</param>
/// <param name="image">Image object to decode to</param>
/// <returns>True if the decode succeeds, otherwise false</returns>
public static bool DecodeToImage(byte[] encoded, out ManagedImage managedImage, out Image image)
{
managedImage = null;
image = null;
if (DecodeToImage(encoded, out managedImage))
{
try
{
image = LoadTGAClass.LoadTGA(new MemoryStream(managedImage.ExportTGA()));
return true;
}
catch (Exception ex)
{
Logger.Log("Failed to export and load TGA data from decoded image", Helpers.LogLevel.Error, ex);
return false;
}
}
else
{
return false;
}
}