本文整理汇总了C#中ExposeEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ExposeEventArgs类的具体用法?C# ExposeEventArgs怎么用?C# ExposeEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExposeEventArgs类属于命名空间,在下文中一共展示了ExposeEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnDrawingarea1ExposeEvent
protected void OnDrawingarea1ExposeEvent(object o, ExposeEventArgs args)
{
foreach (var rect in rects) {
args.Event.Window.DrawRectangle (Style.BlackGC, true, rect);
args.Event.Window.DrawRectangle (Style.WhiteGC, false, rect);
}
}
开发者ID:oklahomaok,项目名称:MonoDevelopSamples,代码行数:7,代码来源:MainWindow.cs
示例2: OnDrawingAreaExposed
void OnDrawingAreaExposed(object o, ExposeEventArgs args)
{
if (prevSize != Allocation.Size)
{
if (model != null)
treeMapModel = new TreeMapModel(model, Allocation.Width, Allocation.Height);
}
DrawingArea area = (DrawingArea)o;
Cairo.Context g = Gdk.CairoHelper.Create(area.GdkWindow);
if (treeMapModel != null)
{
foreach (var item in treeMapModel.Items)
{
double width = item.Rectangle.Width;
double height = item.Rectangle.Height;
double x1 = item.Rectangle.X;
double x2 = item.Rectangle.X + item.Rectangle.Width;
double y1 = item.Rectangle.Y;
double y2 = item.Rectangle.Y + item.Rectangle.Height;
PointD p1, p2, p3, p4;
p1 = new PointD(x1, y1);
p2 = new PointD(x2, y1);
p3 = new PointD(x2, y2);
p4 = new PointD(x1, y2);
g.MoveTo(p1);
g.LineTo(p2);
g.LineTo(p3);
g.LineTo(p4);
g.LineTo(p1);
g.ClosePath();
g.Save();
//using (Gradient pat = new LinearGradient(x1, y1, x2, y2))
using (Gradient pat = new RadialGradient(x1 + (x2 - x1) / 4.0, y1 + (y2 - y1) / 4.0, 3, x1 + (x2 - x1) / 4.0, y1 + (y2 - y1) / 4.0, Math.Sqrt(width*width + height*height)))
{
pat.AddColorStop(0, new Cairo.Color(1, 1, 1, 1));
pat.AddColorStop(1, new Cairo.Color(0, 0, 1, 1));
g.Pattern = pat;
// Fill the path with pattern
g.FillPreserve();
}
// We "undo" the pattern setting here
g.Restore();
g.Color = new Color(0, 0, 0, 0);
g.Stroke();
}
}
((IDisposable)g.Target).Dispose();
((IDisposable)g).Dispose();
}
开发者ID:joncham,项目名称:NDirStat,代码行数:59,代码来源:TreeMapView.cs
示例3: HandleExposeEvent
public void HandleExposeEvent (object sender, ExposeEventArgs args)
{
if (fade_delay == null) {
fade_delay = new Delay (50, new GLib.IdleHandler (Update));
start = DateTime.Now;
fade_delay.Start ();
}
}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:8,代码来源:Fader.cs
示例4: OnChildExposeEvent
private void OnChildExposeEvent(object o, ExposeEventArgs args)
{
if(interactive) {
InteractiveExpose((Widget)o, args.Event);
} else {
StaticExpose((Widget)o, args.Event);
}
}
开发者ID:tcausby,项目名称:giver,代码行数:8,代码来源:ComplexMenuItem.cs
示例5: RotatedTextExposeEvent
void RotatedTextExposeEvent (object sender, ExposeEventArgs a)
{
DrawingArea drawingArea = sender as DrawingArea;
int width = drawingArea.Allocation.Width;
int height = drawingArea.Allocation.Height;
double deviceRadius;
// Get the default renderer for the screen, and set it up for drawing
Gdk.PangoRenderer renderer = Gdk.PangoRenderer.GetDefault (drawingArea.Screen);
renderer.Drawable = drawingArea.GdkWindow;
renderer.Gc = drawingArea.Style.BlackGC;
// Set up a transformation matrix so that the user space coordinates for
// the centered square where we draw are [-RADIUS, RADIUS], [-RADIUS, RADIUS]
// We first center, then change the scale
deviceRadius = Math.Min (width, height) / 2;
Matrix matrix = Pango.Matrix.Identity;
matrix.Translate (deviceRadius + (width - 2 * deviceRadius) / 2, deviceRadius + (height - 2 * deviceRadius) / 2);
matrix.Scale (deviceRadius / RADIUS, deviceRadius / RADIUS);
// Create a PangoLayout, set the font and text
Context context = drawingArea.CreatePangoContext ();
Pango.Layout layout = new Pango.Layout (context);
layout.SetText ("Text");
FontDescription desc = FontDescription.FromString ("Sans Bold 27");
layout.FontDescription = desc;
// Draw the layout N_WORDS times in a circle
for (int i = 0; i < N_WORDS; i++)
{
Gdk.Color color = new Gdk.Color ();
Matrix rotatedMatrix = matrix;
int w, h;
double angle = (360 * i) / N_WORDS;
// Gradient from red at angle == 60 to blue at angle == 300
color.Red = (ushort) (65535 * (1 + Math.Cos ((angle - 60) * Math.PI / 180)) / 2);
color.Green = 0;
color.Blue = (ushort) (65535 - color.Red);
renderer.SetOverrideColor (RenderPart.Foreground, color);
rotatedMatrix.Rotate (angle);
context.Matrix = rotatedMatrix;
// Inform Pango to re-layout the text with the new transformation matrix
layout.ContextChanged ();
layout.GetSize (out w, out h);
renderer.DrawLayout (layout, - w / 2, (int) (- RADIUS * Pango.Scale.PangoScale));
}
// Clean up default renderer, since it is shared
renderer.SetOverrideColor (RenderPart.Foreground, Gdk.Color.Zero);
renderer.Drawable = null;
renderer.Gc = null;
}
开发者ID:liberostelios,项目名称:gtk-sharp,代码行数:58,代码来源:DemoRotatedText.cs
示例6: da_ExposeEvent
/// <summary>
/// Handles ExposeEvents by obtaining a GC from the Gdk.Window
/// and copying the PlotSurface from the cache to the screen
/// </summary>
private void da_ExposeEvent(object o, ExposeEventArgs args)
{
Gdk.Rectangle area = args.Event.Area;
using (Graphics g = Gtk.DotNet.Graphics.FromDrawable (args.Event.Window)){
Rectangle bounds = new Rectangle (area.X, area.Y, area.Width, area.Height);
g.DrawImage (bitmap_cache, bounds, bounds, GraphicsUnit.Pixel);
}
args.RetVal = true;
}
开发者ID:sanyu1,项目名称:NPlot,代码行数:13,代码来源:Gtk.AxisTestsForm.cs
示例7: ExposeEvent
static void ExposeEvent (object obj, ExposeEventArgs args) {
Gdk.Rectangle area = args.Event.Area;
args.Event.Window.DrawDrawable (darea.Style.ForegroundGC(darea.State),
pixmap,
area.X, area.Y,
area.X, area.Y,
area.Width, area.Height);
args.RetVal = false;
}
开发者ID:liberostelios,项目名称:gtk-sharp,代码行数:10,代码来源:ScribbleXInput.cs
示例8: OnExposed
static void OnExposed (object o, ExposeEventArgs args)
{
if (current_frame == null)
return;
current_frame.RenderToDrawable (drawing_area.GdkWindow, drawing_area.Style.ForegroundGC (StateType.Normal),
0, 0,
0, 0,
-1, -1,
RgbDither.None, 0, 0);
}
开发者ID:carriercomm,项目名称:scsharp,代码行数:10,代码来源:animate-grp.cs
示例9: HandleMyWinExposeEvent
void HandleMyWinExposeEvent(object o, ExposeEventArgs args)
{
GLib.Idle.Add (new GLib.IdleHandler (delegate() {
if (cr == null) {
Gtk.Widget widget = ((Gtk.Widget)o);
cr = Gdk.CairoHelper.Create (widget.GdkWindow);
}
WindowController.DrawPixbuf (cr, pixbuf);
return false;
}));
}
开发者ID:niwakazoider,项目名称:unicast,代码行数:11,代码来源:ImageWindow.cs
示例10: OnGraphEventBoxExposeEvent
protected void OnGraphEventBoxExposeEvent(object o, ExposeEventArgs args)
{
if (((DrawingArea)o).GdkWindow != null)
{
using(ImageSurface tmpSurface = new ImageSurface(Format.Rgb24, ((DrawingArea)o).Allocation.Width, ((DrawingArea)o).Allocation.Height))
using(GtkGraphDrawer drawer = new GtkGraphDrawer(Gdk.CairoHelper.Create(((DrawingArea)o).GdkWindow), new Context(tmpSurface), tmpSurface))
{
BaseGraph.DrawFullGraph (drawer);
}
}
}
开发者ID:ivynetca,项目名称:lapsestudio,代码行数:11,代码来源:Graph.cs
示例11: OnExpose
void OnExpose(object sender, ExposeEventArgs args)
{
DrawingArea area = (DrawingArea)sender;
Cairo.Context cr = Gdk.CairoHelper.Create(area.GdkWindow);
int width = Allocation.Width;
int height = Allocation.Height;
cr.Translate(width / 2, height / 2);
//
{
cr.LineWidth = 3;
cr.LineCap = LineCap.Round;
const int MAX_ROT = 8;
for (int i = 0; i < MAX_ROT; i++)
{
cr.SetSourceRGBA(0, 0, 0, trs[count%MAX_ROT, i]);
cr.MoveTo(0.0, -10.0);
cr.LineTo(0.0, -40.0);
cr.Rotate(Math.PI / 4);
cr.Stroke();
}
}
// draw donut
{
//cr.SetSourceRGBA(0, 0, 0, 1);
cr.LineWidth = 0.5;
cr.Arc(0, 0, 120, 0, 2 * Math.PI);
cr.Stroke();
cr.Save();
const int MAX_ROT = 36;
for (int i = 0; i < MAX_ROT; i++)
{
//cr.SetSourceRGBA(0, 0, 0, 1);
cr.Rotate(i * Math.PI / MAX_ROT);
cr.Scale(0.3, 1);
cr.Arc(0, 0, 120, 0, 2 * Math.PI);
cr.Restore();
cr.Stroke();
cr.Save();
}
}
((IDisposable) cr.GetTarget()).Dispose();
((IDisposable) cr).Dispose();
}
开发者ID:oraora81,项目名称:NOCmono,代码行数:53,代码来源:MainWindow_Cairo2.cs
示例12: ExposeEventCallback
// Expose callback for the drawing area
private void ExposeEventCallback (object o, ExposeEventArgs args)
{
EventExpose eventExpose = args.Event;
Gdk.Window window = eventExpose.Window;
Rectangle area = eventExpose.Area;
window.DrawRectangle (drawingArea.Style.BackgroundGC (StateType.Normal),
true,
area.X, area.Y,
area.Width, area.Height);
args.RetVal = true;
}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:13,代码来源:DemoColorSelection.cs
示例13: ExposeHandler
static void ExposeHandler (object obj, ExposeEventArgs args)
{
Gdk.EventExpose ev = args.Event;
Gdk.Window window = ev.Window;
using (Graphics g = Gtk.DotNet.Graphics.FromDrawable (window)){
g.TranslateTransform (ev.Area.X, ev.Area.Y);
using (Pen p = new Pen (Color.Red)){
g.DrawPie (p, 0, 0, rect.Width, rect.Height, 50, 90);
}
}
}
开发者ID:liberostelios,项目名称:gtk-sharp,代码行数:12,代码来源:DrawingSample.cs
示例14: HandleExposeEvent
static void HandleExposeEvent (object sender, ExposeEventArgs expose_args)
{
Widget w = (Widget)sender;
using (Cairo.Context ctx = CompositeHelper.Create (w.GdkWindow)){
double opacity = 0;
ctx.Operator = Cairo.Operator.Source;
if (moon_host.Content is Moon.Windows.Desktop.Window)
opacity = ((Moon.Windows.Desktop.Window)moon_host.Content).WindowOpacity;
ctx.Color = new Cairo.Color (1.0, 1.0, 1.0, opacity);
CompositeHelper.Region (ctx, expose_args.Event.Region);
ctx.Fill ();
}
}
开发者ID:dfr0,项目名称:moon,代码行数:14,代码来源:mopen.cs
示例15: ExposeHandler
static void ExposeHandler (object o, ExposeEventArgs args)
{
Console.WriteLine ("exposed");
Widget widget = o as Widget;
//using (Cairo.Context cr = new Cairo.Context (surface)) {
cr.Save ();
cr.Rectangle (0, 0, widget.Allocation.Width, widget.Allocation.Height);
//cr.Color = new Color ( 1, 1, 1, 1);
Gdk.CairoHelper.SetSourceColor (cr, widget.Style.Background (widget.State));
cr.Fill ();
cr.Restore ();
cr.Save ();
cr.LineWidth = 1;
cr.MoveTo (10, 10);
cr.LineTo (20, 10);
cr.LineTo (20, 20);
cr.LineTo (10, 20);
cr.ClosePath ();
cr.Color = new Cairo.Color ( 0, 0, 0, 1);
cr.Fill ();
cr.Restore ();
//NDesk.Glitz.Context ctx = new NDesk.Glitz.Context (ggd, ggd.Format);
//Console.WriteLine (ggs.ValidTarget);
//Console.WriteLine ("proc ptr: " + ctx.GetProcAddress ("glBindProgramARB"));
//ctx.MakeCurrent (ggd);
//GlHelper.Draw ();
//GlHelper.DrawT ();
ggs.Flush ();
if (doublebuffer)
ggd.SwapBuffers ();
else
ggd.Flush ();
args.RetVal = true;
//args.RetVal = false;
//}
}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:47,代码来源:Demo.cs
示例16: OnDrawingarea1ExposeEvent
protected void OnDrawingarea1ExposeEvent (object o, ExposeEventArgs args)
{
var cw = new ContextWrapper (o);
cw.Translate (cw.Center);
cw.Context.LineWidth = 1;
cw.Circle (0, 0, 50);
cw.Context.StrokePreserve ();
cw.PushColor ();
cw.Color = new Color2 ("#FFC0CB");
cw.Context.Fill ();
cw.Circle (-50, -50, 100);
cw.PopColor ();
cw.Context.StrokePreserve ();
cw.Color = new Color2 ("yellow", 0.5);
cw.Context.Fill ();
cw.Color = new Color2 ("black");
cw.RoundedRectangle (new Rectangle(50, 50, 100, 50), 15);
cw.Context.Stroke ();
cw.Context.IdentityMatrix ();
cw.Translate (cw.Center);
var rnd = new Random ();
var points = new PointD[15];
for (var i = 0; i < points.Length; i++) {
var p = new PointD (rnd.Next (200) - 100, rnd.Next (200) - 100);
points[i] = p;
}
cw.Polygon (points);
cw.Context.StrokePreserve ();
cw.Context.Fill ();
cw.Close ();
}
开发者ID:roman-yagodin,项目名称:Cairo.R7,代码行数:46,代码来源:MainWindow.cs
示例17: OnExposed
void OnExposed (object sender, ExposeEventArgs e)
{
Context cr = Gdk.CairoHelper.Create (da.GdkWindow);
int w, h;
da.GdkWindow.GetSize (out w, out h);
// set window bg
cr.ColorRgb = new Color (1, 1, 1 );
cr.Rectangle (0, 0, w, h);
cr.Fill ();
// reset it
cr.ColorRgb = new Color (0, 0, 0);
Snippets.InvokeSnippet (snips, selected, cr, w, h);
e.RetVal = true;
}
开发者ID:REALTOBIZ,项目名称:mono,代码行数:18,代码来源:SnippetsGtk.cs
示例18: OnDrawPlayPauseExposeEvent
protected void OnDrawPlayPauseExposeEvent(object o, ExposeEventArgs args)
{
using(Context context = Gdk.CairoHelper.Create (((DrawingArea)o).GdkWindow))
{
context.Rectangle(0, 0, 16, 16);
context.SetSourceRGB(.8, .8, .8);
context.Fill();
context.LineWidth = 1;
if(_playing) {
if (_mode == ProgramMode.Presentation) {
context.SetSourceRGB (1.0, 0.0, 0.0);
} else {
context.SetSourceRGB (0.4, 0.4, 0.4);
}
context.MoveTo (2, 2);
context.LineTo (2, 13);
context.LineTo (13, 13);
context.LineTo (13, 2);
context.LineTo (2, 2);
context.StrokePreserve();
context.MoveTo (7, 7);
context.Fill();
} else {
if (_mode == ProgramMode.Presentation) {
context.SetSourceRGB (0.0, 1.0, 0.0);
} else {
context.SetSourceRGB (0.4, 0.4, 0.4);
}
context.MoveTo (3, 1);
context.LineTo (3, 14);
context.LineTo (12, 8);
context.LineTo (12, 7);
context.LineTo (3, 1);
context.StrokePreserve();
context.MoveTo (7, 7);
context.Fill();
}
}
}
开发者ID:codingcave,项目名称:CoupledOdeViewer,代码行数:43,代码来源:MainWindow.Expose.cs
示例19: OnBannerExposed
private void OnBannerExposed(object o, ExposeEventArgs args)
{
if(args.Event.Count > 0)
return;
Gdk.Pixbuf spb =
ScaledPixbuf.ScaleSimple(iFolderScaledBanner.Allocation.Width,
iFolderScaledBanner.Allocation.Height,
Gdk.InterpType.Nearest);
Gdk.GC gc = new Gdk.GC(iFolderScaledBanner.GdkWindow);
spb.RenderToDrawable(iFolderScaledBanner.GdkWindow,
gc,
0, 0,
args.Event.Area.X,
args.Event.Area.Y,
args.Event.Area.Width,
args.Event.Area.Height,
Gdk.RgbDither.Normal,
0, 0);
}
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:19,代码来源:VerifyPassPhraseDialog.cs
示例20: Expose
// Expose callback for the drawing area
void Expose (object o, ExposeEventArgs args)
{
Widget widget = (Widget) o;
Gdk.Rectangle area = args.Event.Area;
byte[] pixels;
int rowstride;
rowstride = frame.Rowstride;
pixels = new byte[(frame.Height - area.Y) * rowstride];
IntPtr src = (IntPtr)(frame.Pixels.ToInt64 () + rowstride * area.Y + area.X * 3);
Marshal.Copy (src, pixels, 0, pixels.Length);
widget.GdkWindow.DrawRgbImageDithalign (widget.Style.BlackGC,
area.X, area.Y, area.Width, area.Height,
Gdk.RgbDither.Normal,
pixels, rowstride,
area.X, area.Y);
args.RetVal = true;
}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:20,代码来源:DemoPixbuf.cs
注:本文中的ExposeEventArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论