Beispiel #1
0
        public static bool TryGetBitmapInfo(ANDROIDGFX.AndroidBitmapInfo src, bool srcIsPremultiplied, out BitmapInfo dst)
        {
            if (TryGetPixelFormat(src.Format, srcIsPremultiplied, out var dstFmt))
            {
                dst = new BitmapInfo((int)src.Width, (int)src.Height, dstFmt, (int)src.Stride);
                return(true);
            }

            dst = default;
            return(false);
        }
Beispiel #2
0
 public static BitmapInfo ToInterop(this ANDROIDGFX.AndroidBitmapInfo info, PixelFormat?defFmt = null)
 {
     return(_Implementation.TryGetBitmapInfo(info, false, out var fmt)
         ? fmt
         : new BitmapInfo((int)info.Width, (int)info.Height, defFmt.Value, (int)info.Stride));
 }