public SizeF MeasureString(string s, Font font, int width, StringFormat format) { int szWidth, szHeight; LibIGraph.MeasureString(this.native, s, font.native, width, format.native, out szWidth, out szHeight); return(new SizeF(szWidth, szHeight)); }
public FontFamily(string name) { this.native = LibIGraph.CreateFontFamily_Name(name); if (this.native == IntPtr.Zero) { throw new ArgumentException("Font '" + name + "' cannot be found."); } }
protected virtual void Dispose(bool disposing) { if (this.native != IntPtr.Zero) { LibIGraph.DisposeBrush(this.native); this.native = IntPtr.Zero; } }
public void Dispose() { if (this.native != null) { LibIGraph.DisposeRegion(this.native); this.native = IntPtr.Zero; GC.SuppressFinalize(this); } }
public void Dispose() { if (this.native != IntPtr.Zero) { LibIGraph.DisposeStringFormat(this.native); this.native = IntPtr.Zero; GC.SuppressFinalize(this); } }
public void Dispose() { if (this.native != IntPtr.Zero) { LibIGraph.DisposeFontFamily(this.native); this.native = IntPtr.Zero; GC.SuppressFinalize(this); } }
public StringFormat(StringFormatFlags options) { this.native = LibIGraph.CreateStringFormat (StringAlignment.Near, options, StringAlignment.Near, StringTrimming.None); this.trimming = StringTrimming.None; this.alignment = StringAlignment.Near; this.lineAlignment = StringAlignment.Near; this.stringFormatFlags = options; }
public Pen(Color color, float width) { if (width < 1.0f) { width = 1.0f; } this.color = color; this.width = width; native = LibIGraph.CreatePen_Color(width, color.ToArgb()); }
public Bitmap(int width, int height, PixelFormat pixelFormat) { base.native = LibIGraph._CreateBitmap(width, height, pixelFormat); if (base.native == IntPtr.Zero) { throw new ArgumentException(); } base.width = width; base.height = height; base.pixelFormat = pixelFormat; }
private void Dispose(bool disposing) { if (!this.canChange && disposing) { throw new ArgumentException("This Pen cannot be disposed of."); } if (this.native != IntPtr.Zero) { LibIGraph.DisposePen(this.native); this.native = IntPtr.Zero; } }
public static Image FromFile(string filename) { if (string.IsNullOrEmpty(filename)) { throw new ArgumentNullException("filename"); } int width, height; PixelFormat pixelFormat; IntPtr native = LibIGraph.BitmapFromFile(filename, out width, out height, out pixelFormat); return(new Bitmap(native, width, height, pixelFormat)); }
public static Graphics FromImage(Image image) { if (image == null) { throw new ArgumentNullException("image"); } IntPtr native = LibIGraph.GetGraphicsFromImage(image.native); if (native == IntPtr.Zero) { throw new ArgumentException("Failed to get Graphics from given Image", "image"); } return(new Graphics(image.Width, image.Height, image.PixelFormat, native)); }
public static Graphics FromHdc(IntPtr hdc) { if (hdc != IntPtr.Zero) { throw new NotImplementedException(); } int xSize, ySize; PixelFormat pixelFormat; IntPtr native = LibIGraph.GetScreen(out xSize, out ySize, out pixelFormat); if (native == IntPtr.Zero) { throw new Exception("CreateScreen() failed"); } return(new Graphics(xSize, ySize, pixelFormat, native)); }
public void Clear(Color color) { LibIGraph.Clear(this.native, color.ToArgb()); }
public Region() { this.native = LibIGraph.CreateRegion_Infinite(); this.isInfinite = true; }
public void CopyFromScreen(int srcX, int srcY, int destX, int destY, Size size) { LibIGraph.Graphics_CopyFromScreen(this.native, srcX, srcY, destX, destY, size.Width, size.Height); }
public Region(Rectangle rect) { this.native = LibIGraph.CreateRegion_Rect(rect.X, rect.Y, rect.Width, rect.Height); this.isInfinite = false; }
public void DrawImageUnscaled(Image image, int x, int y) { LibIGraph.DrawImageUnscaled(this.native, image.native, x, y); }
public void DrawString(string s, Font font, Brush brush, float x, float y, StringFormat format) { LibIGraph.DrawString(this.native, s, font.native, brush.native, (int)x, (int)y, int.MaxValue, int.MaxValue, (format == null) ? IntPtr.Zero : format.native); }
public void DrawString(string s, Font font, Brush brush, RectangleF rect, StringFormat format) { LibIGraph.DrawString(this.native, s, font.native, brush.native, (int)rect.Left, (int)rect.Top, (int)rect.Right, (int)rect.Bottom, format.native); }
public void DrawEllipse(Pen pen, int x, int y, int width, int height) { LibIGraph.DrawEllipse_Ints(this.native, pen.native, x, y, width, height); }
public void FillEllipse(Brush brush, int x, int y, int width, int height) { LibIGraph.FillEllipse_Ints(this.native, brush.native, x, y, width, height); }
public void DrawLine(Pen pen, Point pt1, Point pt2) { LibIGraph.DrawLine_Ints(this.native, pen.native, pt1.X, pt1.Y, pt2.X, pt2.Y); }
public void DrawLine(Pen pen, int x1, int y1, int x2, int y2) { LibIGraph.DrawLine_Ints(this.native, pen.native, x1, y1, x2, y2); }
public SolidBrush(Color col) { this.col = col; base.native = LibIGraph.CreateBrush_Solid(col.ToArgb()); }
public Font(string familyName, float emSize) { this.family = new FontFamily(familyName); this.native = LibIGraph._CreateFont(this.family.native, emSize, FontStyle.Regular); }
public Font(FontFamily family, float emSize, FontStyle style) { this.family = family; this.native = LibIGraph._CreateFont(family.native, emSize, style); }