mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-07-14 02:54:16 -04:00
Code moved out of UnityStudioForm and into new class UnityStudio.cs (#17)
This commit is contained in:
@ -177,7 +177,7 @@ namespace Unity_Studio
|
||||
else
|
||||
{
|
||||
EndianStream estream = null;
|
||||
if (UnityStudioForm.assetsfileandstream.TryGetValue(Path.GetFileName(path), out estream))
|
||||
if (UnityStudio.assetsfileandstream.TryGetValue(Path.GetFileName(path), out estream))
|
||||
{
|
||||
estream.Position = offset;
|
||||
image_data = estream.ReadBytes(image_data_size);
|
||||
@ -981,20 +981,28 @@ namespace Unity_Studio
|
||||
|
||||
private Bitmap BGRA32ToBitmap()
|
||||
{
|
||||
var hObject = GCHandle.Alloc(image_data, GCHandleType.Pinned);
|
||||
var pObject = hObject.AddrOfPinnedObject();
|
||||
var bitmap = new Bitmap(m_Width, m_Height, m_Width * 4, PixelFormat.Format32bppArgb, pObject);
|
||||
hObject.Free();
|
||||
return bitmap;
|
||||
if (image_data.Length > 0)
|
||||
{
|
||||
var hObject = GCHandle.Alloc(image_data, GCHandleType.Pinned);
|
||||
var pObject = hObject.AddrOfPinnedObject();
|
||||
var bitmap = new Bitmap(m_Width, m_Height, m_Width * 4, PixelFormat.Format32bppArgb, pObject);
|
||||
hObject.Free();
|
||||
return bitmap;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Bitmap RGB565ToBitmap()
|
||||
{
|
||||
var hObject = GCHandle.Alloc(image_data, GCHandleType.Pinned);
|
||||
var pObject = hObject.AddrOfPinnedObject();
|
||||
var bitmap = new Bitmap(m_Width, m_Height, m_Width * 2, PixelFormat.Format16bppRgb565, pObject);
|
||||
hObject.Free();
|
||||
return bitmap;
|
||||
if (image_data.Length > 0)
|
||||
{
|
||||
var hObject = GCHandle.Alloc(image_data, GCHandleType.Pinned);
|
||||
var pObject = hObject.AddrOfPinnedObject();
|
||||
var bitmap = new Bitmap(m_Width, m_Height, m_Width * 2, PixelFormat.Format16bppRgb565, pObject);
|
||||
hObject.Free();
|
||||
return bitmap;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Bitmap PVRToBitmap(byte[] pvrdata)
|
||||
|
Reference in New Issue
Block a user