public IRenderTargetBitmapImpl CreateLayer(
     IVisual layerRoot,
     Size size,
     double dpiX,
     double dpiY)
 {
     return(_renderInterface.CreateRenderTargetBitmap(
                (int)Math.Ceiling(size.Width),
                (int)Math.Ceiling(size.Height),
                dpiX,
                dpiY));
 }
Beispiel #2
0
        /// <summary>
        /// Creates a platform-specific imlementation for a <see cref="RenderTargetBitmap"/>.
        /// </summary>
        /// <param name="width">The width of the bitmap.</param>
        /// <param name="height">The height of the bitmap.</param>
        /// <returns>The platform-specific implementation.</returns>
        private static IBitmapImpl CreateImpl(int width, int height)
        {
            IPlatformRenderInterface factory = PerspexLocator.Current.GetService <IPlatformRenderInterface>();

            return(factory.CreateRenderTargetBitmap(width, height));
        }
Beispiel #3
0
        /// <summary>
        /// Creates a platform-specific imlementation for a <see cref="RenderTargetBitmap"/>.
        /// </summary>
        /// <param name="width">The width of the bitmap.</param>
        /// <param name="height">The height of the bitmap.</param>
        /// <param name="dpiX">The horizontal DPI of the bitmap.</param>
        /// <param name="dpiY">The vertical DPI of the bitmap.</param>
        /// <returns>The platform-specific implementation.</returns>
        private static IBitmapImpl CreateImpl(int width, int height, double dpiX, double dpiY)
        {
            IPlatformRenderInterface factory = AvaloniaLocator.Current.GetService <IPlatformRenderInterface>();

            return(factory.CreateRenderTargetBitmap(width, height, dpiX, dpiY));
        }
Beispiel #4
0
        /// <summary>
        /// Creates a platform-specific implementation for a <see cref="RenderTargetBitmap"/>.
        /// </summary>
        /// <param name="size">The size of the bitmap in device pixels.</param>
        /// <param name="dpi">The DPI of the bitmap.</param>
        /// <returns>The platform-specific implementation.</returns>
        private static IRenderTargetBitmapImpl CreateImpl(PixelSize size, Vector dpi)
        {
            IPlatformRenderInterface factory = AvaloniaLocator.Current.GetRequiredService <IPlatformRenderInterface>();

            return(factory.CreateRenderTargetBitmap(size, dpi));
        }