Exemplo n.º 1
0
        // write a metafile stream to the output stream in PNG format
        internal static void SaveMetafileToImageStream(MemoryStream metafileStream, Stream imageStream)
        {
            SystemDrawingExtensionMethods extensions = AssemblyHelper.ExtensionsForSystemDrawing(force: true);

            if (extensions != null)
            {
                extensions.SaveMetafileToImageStream(metafileStream, imageStream);
            }
        }
Exemplo n.º 2
0
        // load the extension class for System.Drawing
        internal static SystemDrawingExtensionMethods ExtensionsForSystemDrawing(bool force = false)
        {
            if (_systemDrawingExtensionMethods == null &&
                (force || IsLoaded(UncommonAssembly.System_Drawing)))
            {
                _systemDrawingExtensionMethods = (SystemDrawingExtensionMethods)LoadExtensionFor("SystemDrawing");
            }

            return(_systemDrawingExtensionMethods);
        }
Exemplo n.º 3
0
        internal static IntPtr GetHBitmap(object data, out int width, out int height)
        {
            SystemDrawingExtensionMethods extensions = AssemblyHelper.ExtensionsForSystemDrawing(force: true);

            if (extensions != null)
            {
                return(extensions.GetHBitmap(data, out width, out height));
            }

            width = height = 0;
            return(IntPtr.Zero);
        }
Exemplo n.º 4
0
        internal static IntPtr GetHBitmapFromBitmap(object data)
        {
            SystemDrawingExtensionMethods extensions = AssemblyHelper.ExtensionsForSystemDrawing();

            return((extensions != null) ? extensions.GetHBitmapFromBitmap(data) : IntPtr.Zero);
        }
Exemplo n.º 5
0
        // Get a bitmap from the given data (either BitmapSource or Bitmap)
        internal static object GetBitmap(object data)
        {
            SystemDrawingExtensionMethods extensions = AssemblyHelper.ExtensionsForSystemDrawing(force: true);

            return((extensions != null) ? extensions.GetBitmap(data) : null);
        }
Exemplo n.º 6
0
        // Get the metafile from the handle of the enhanced metafile.
        internal static Object GetMetafileFromHemf(IntPtr hMetafile)
        {
            SystemDrawingExtensionMethods extensions = AssemblyHelper.ExtensionsForSystemDrawing(force: true);

            return((extensions != null) ? extensions.GetMetafileFromHemf(hMetafile) : null);
        }
Exemplo n.º 7
0
        internal static IntPtr GetHandleFromMetafile(Object data)
        {
            SystemDrawingExtensionMethods extensions = AssemblyHelper.ExtensionsForSystemDrawing();

            return((extensions != null) ? extensions.GetHandleFromMetafile(data) : IntPtr.Zero);
        }
Exemplo n.º 8
0
        // return true if the data is a graphics metafile
        internal static bool IsMetafile(object data)
        {
            SystemDrawingExtensionMethods extensions = AssemblyHelper.ExtensionsForSystemDrawing();

            return((extensions != null) ? extensions.IsMetafile(data) : false);
        }
Exemplo n.º 9
0
        internal static object GetBitmapFromBitmapSource(object source)
        {
            SystemDrawingExtensionMethods extensions = AssemblyHelper.ExtensionsForSystemDrawing(force: true);

            return((extensions != null) ? extensions.GetBitmapFromBitmapSource(source) : null);
        }
Exemplo n.º 10
0
        // return a new default-printing permission
        internal static CodeAccessPermission NewDefaultPrintingPermission()
        {
            SystemDrawingExtensionMethods extensions = AssemblyHelper.ExtensionsForSystemDrawing(force: true);

            return((extensions != null) ? extensions.NewDefaultPrintingPermission() : null);
        }
Exemplo n.º 11
0
        // return a stream for the ExifUserComment in the given Gif
        internal static Stream GetCommentFromGifStream(Stream stream)
        {
            SystemDrawingExtensionMethods extensions = AssemblyHelper.ExtensionsForSystemDrawing(force: true);

            return((extensions != null) ? extensions.GetCommentFromGifStream(stream) : null);
        }
Exemplo n.º 12
0
        internal static IntPtr ConvertMetafileToHBitmap(IntPtr handle)
        {
            SystemDrawingExtensionMethods extensions = AssemblyHelper.ExtensionsForSystemDrawing(force: true);

            return((extensions != null) ? extensions.ConvertMetafileToHBitmap(handle) : IntPtr.Zero);
        }
Exemplo n.º 13
0
        // load the extension class for System.Drawing
        internal static SystemDrawingExtensionMethods ExtensionsForSystemDrawing(bool force=false)
        {
            if (_systemDrawingExtensionMethods == null &&
                (force || IsLoaded(UncommonAssembly.System_Drawing)))
            {
                _systemDrawingExtensionMethods = (SystemDrawingExtensionMethods)LoadExtensionFor("SystemDrawing");
            }

            return _systemDrawingExtensionMethods;
        }