FT_Glyph_To_Bitmap() private method

private FT_Glyph_To_Bitmap ( IntPtr &the_glyph, RenderMode render_mode, FTVector26Dot6 &origin, [ destroy ) : System.Error
the_glyph System.IntPtr
render_mode RenderMode
origin FTVector26Dot6
destroy [
return System.Error
Beispiel #1
0
        /// <summary>
        /// Convert a given glyph object to a bitmap glyph object.
        /// </summary>
        /// <remarks><para>
        /// This function does nothing if the glyph format isn't scalable.
        /// </para><para>
        /// The glyph image is translated with the ‘origin’ vector before rendering.
        /// </para><para>
        /// The first parameter is a pointer to an <see cref="Glyph"/> handle, that will be replaced by this function
        /// (with newly allocated data). Typically, you would use (omitting error handling):
        /// </para><para>
        /// --sample code ommitted--
        /// </para></remarks>
        /// <param name="renderMode">An enumeration that describes how the data is rendered.</param>
        /// <param name="origin">
        /// A pointer to a vector used to translate the glyph image before rendering. Can be 0 (if no translation). The
        /// origin is expressed in 26.6 pixels.
        /// </param>
        /// <param name="destroy">
        /// A boolean that indicates that the original glyph image should be destroyed by this function. It is never
        /// destroyed in case of error.
        /// </param>
        public Glyph ToBitmap(RenderMode renderMode, FTVector26Dot6 origin, bool destroy)
        {
            IntPtr glyphRef = Reference;
            Error  err      = FT.FT_Glyph_To_Bitmap(ref glyphRef, renderMode, ref origin, destroy);

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

            return(new Glyph(glyphRef, Library));
        }
Beispiel #2
0
        /// <summary>
        /// Convert a given glyph object to a bitmap glyph object.
        /// </summary>
        /// <remarks><para>
        /// This function does nothing if the glyph format isn't scalable.
        /// </para><para>
        /// The glyph image is translated with the ‘origin’ vector before rendering.
        /// </para><para>
        /// The first parameter is a pointer to an <see cref="Glyph"/> handle, that will be replaced by this function
        /// (with newly allocated data). Typically, you would use (omitting error handling):
        /// </para><para>
        /// --sample code ommitted--
        /// </para></remarks>
        /// <param name="renderMode">An enumeration that describes how the data is rendered.</param>
        /// <param name="origin">
        /// A pointer to a vector used to translate the glyph image before rendering. Can be 0 (if no translation). The
        /// origin is expressed in 26.6 pixels.
        /// </param>
        /// <param name="destroy">
        /// A boolean that indicates that the original glyph image should be destroyed by this function. It is never
        /// destroyed in case of error.
        /// </param>
        public void ToBitmap(RenderMode renderMode, FTVector origin, bool destroy)
        {
            if (disposed)
            {
                throw new ObjectDisposedException("Glyph", "Cannot access a disposed object.");
            }

            IntPtr glyphRef = Reference;
            Error  err      = FT.FT_Glyph_To_Bitmap(ref glyphRef, renderMode, ref origin, destroy);

            Reference = glyphRef;

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