Example #1
0
        public void DrawText(string text, int offset, int len, ImageColor color, Font font, ImagePosition position)
        {
            int errorCode = Image.DrawTextNative(this.handle, text, offset, len, ref color, font.Handle, ref position);

            if (errorCode != 0)
            {
                Error.ThrowNativeException(errorCode);
            }
        }
Example #2
0
        public void DrawRectangle(ImageColor color, ImageRect rect)
        {
            int errorCode = Image.DrawRectangleNative(this.handle, ref color, ref rect);

            if (errorCode != 0)
            {
                Error.ThrowNativeException(errorCode);
            }
        }
Example #3
0
        public Image(ImageMode mode, ImageSize size, ImageColor color)
        {
            int errorCode = Image.NewFromModeSizeColor(mode, ref size, ref color, out this.handle);

            if (errorCode < 0)
            {
                Error.ThrowNativeException(errorCode);
            }
        }
Example #4
0
 private static extern int DrawTextNative(int handle, string text, int offset, int len, ref ImageColor color, int font_handle, ref ImagePosition position);
Example #5
0
 private static extern int DrawRectangleNative(int handle, ref ImageColor color, ref ImageRect rect);
Example #6
0
 /// <summary>Renders text within the image (all of the character string)</summary>
 /// <param name="text">Character string</param>
 /// <param name="color">Font color</param>
 /// <param name="font">Font</param>
 /// <param name="position">Coordinate within the image (upper left of the text)</param>
 /// <remarks>DrawText is the action of rendering text on a transparent image. The RGB value is overwritten with the color provided by the color argument, and the Alpha value is blended.</remarks>
 /// <remarks>When DrawText is called for an opaque image, the expected effect cannot be obtained.</remarks>
 public void DrawText(string text, ImageColor color, Font font, ImagePosition position)
 {
     this.DrawText(text, 0, text.Length, color, font, position);
 }
Example #7
0
 private static extern int NewFromModeSizeColor(ImageMode mode, ref ImageSize size, ref ImageColor color, out int handle);