Update
svn path=/trunk/gtk-sharp/; revision=43627
This commit is contained in:
parent
01b62e8572
commit
a49ba2d3a1
1 changed files with 34 additions and 3 deletions
|
@ -28,11 +28,42 @@
|
||||||
<Parameter Name="drawable" Type="Gdk.Drawable" />
|
<Parameter Name="drawable" Type="Gdk.Drawable" />
|
||||||
</Parameters>
|
</Parameters>
|
||||||
<Docs>
|
<Docs>
|
||||||
<summary>Gets a Graphics context for a drawable.</summary>
|
<summary>Gets a <see cref="T:System.Drawing.Graphics" /> context for a <see cref="T:Gdk.Drawable" /></summary>
|
||||||
<param name="drawable">a <see cref="T:Gdk.Drawable" /></param>
|
<param name="drawable">a <see cref="T:Gdk.Drawable" /></param>
|
||||||
<returns>a <see cref="T:System.Drawing.Graphics" /></returns>
|
<returns>a <see cref="T:System.Drawing.Graphics" /></returns>
|
||||||
<remarks />
|
<remarks>Use this method to obtain a System.Drawing.Graphics context from a Gtk drawable.
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Both pixmaps (<see cref="T:Gdk.Pixmap" />) and windows (<see cref="T:Gdk.Window" />) are drawables (<see cref="T:Gdk.Drawable" />).
|
||||||
|
</para><para>
|
||||||
|
The following example shows how to create a custom widget that renders a mesh. This example overrides the OnExposeEvent method and uses <see cref="N:System.Drawing" /> calls to do the actual drawing:
|
||||||
|
</para><example>
|
||||||
|
<code lang="C#">
|
||||||
|
using System.Drawing;
|
||||||
|
using Gtk;
|
||||||
|
|
||||||
|
class PrettyGraphic : DrawingArea {
|
||||||
|
|
||||||
|
public PrettyGraphic ()
|
||||||
|
{
|
||||||
|
SetSizeRequest (200, 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool OnExposeEvent (Gdk.EventExpose args)
|
||||||
|
{
|
||||||
|
using (Graphics g = Gtk.DotNet.Graphics.FromDrawable (args.Window)){
|
||||||
|
Pen p = new Pen (Color.Blue, 1.0f);
|
||||||
|
|
||||||
|
for (int i = 0; i < 600; i += 60)
|
||||||
|
for (int j = 0; j < 600; j += 60)
|
||||||
|
g.DrawLine (p, i, 0, 0, j);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</code>
|
||||||
|
</example></remarks>
|
||||||
</Docs>
|
</Docs>
|
||||||
</Member>
|
</Member>
|
||||||
</Members>
|
</Members>
|
||||||
</Type>
|
</Type>
|
Loading…
Add table
Reference in a new issue