Ejemplo n.º 1
0
        public static BitmapImage?extractBitmap(this PakIndex pakIndex, string fullPath)
        {
            var package = pakIndex.extractPackage(fullPath);
            var texture = package?.GetExport <UTexture2D>();

            if (texture == null)
            {
                EventLogger.logError($"Could not get texture from package {fullPath}");
                return(null);
            }
            var bitmap = AppModel.bitmapImageFromSKImage(texture.Image);

            if (bitmap == null)
            {
                EventLogger.logError($"Could not get bitmap from texture {fullPath}");
                return(null);
            }
            bitmap.Freeze();
            return(bitmap);
        }