FT_Bitmap_Copy() private method

private FT_Bitmap_Copy ( IntPtr library, IntPtr source, IntPtr target ) : System.Error
library System.IntPtr
source System.IntPtr
target System.IntPtr
return System.Error
Ejemplo n.º 1
0
        /// <summary>
        /// Copy a bitmap into another one.
        /// </summary>
        /// <param name="library">A handle to a library object.</param>
        /// <returns>A handle to the target bitmap.</returns>
        public FTBitmap Copy(Library library)
        {
            if (disposed)
            {
                throw new ObjectDisposedException("FTBitmap", "Cannot access a disposed object.");
            }

            if (library == null)
            {
                throw new ArgumentNullException("library");
            }

            FTBitmap newBitmap = new FTBitmap(library);
            IntPtr   bmpRef    = newBitmap.reference;
            Error    err       = FT.FT_Bitmap_Copy(library.Reference, Reference, bmpRef);

            newBitmap.Reference = bmpRef;

            if (err != Error.Ok)
            {
                throw new FreeTypeException(err);
            }

            return(newBitmap);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Copy a bitmap into another one.
        /// </summary>
        /// <param name="library">A handle to a library object.</param>
        /// <returns>A handle to the target bitmap.</returns>
        public FTBitmap Copy(Library library)
        {
            if (library == null)
            {
                throw new ArgumentNullException("library");
            }

            FTBitmap newBitmap = new FTBitmap(library);
            IntPtr   bmpRef    = newBitmap.Reference;
            Error    err       = FT.FT_Bitmap_Copy(library.Reference, Reference, bmpRef);

            if (err != Error.Ok)
            {
                throw new FreeTypeException(err);
            }

            return(newBitmap);
        }