本文整理汇总了C#中Widget.GetBackend方法的典型用法代码示例。如果您正苦于以下问题:C# Widget.GetBackend方法的具体用法?C# Widget.GetBackend怎么用?C# Widget.GetBackend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Widget
的用法示例。
在下文中一共展示了Widget.GetBackend方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderWidget
public override object RenderWidget(Widget w)
{
var view = ((ViewBackend)w.GetBackend ()).Widget;
view.LockFocus ();
return new NSImage (view.DataWithPdfInsideRect (view.Bounds));
}
示例2: RenderWidget
public override object RenderWidget (Widget w)
{
var view = ((ViewBackend)w.GetBackend ()).Widget;
view.LockFocus ();
var img = new NSImage (view.DataWithPdfInsideRect (view.Bounds));
var imageData = img.AsTiff ();
var imageRep = (NSBitmapImageRep)NSBitmapImageRep.ImageRepFromData (imageData);
var im = new NSImage ();
im.AddRepresentation (imageRep);
im.Size = new System.Drawing.SizeF ((float)view.Bounds.Width, (float)view.Bounds.Height);
return im;
}
示例3: RenderWidget
public override object RenderWidget(Widget widget)
{
try {
var w = ((WidgetBackend)widget.GetBackend ()).Widget;
RenderTargetBitmap rtb = new RenderTargetBitmap ((int)w.ActualWidth, (int)w.ActualHeight, 96, 96, PixelFormats.Pbgra32);
rtb.Render(w);
return new WpfImage(rtb);
} catch (Exception ex) {
throw new InvalidOperationException ("Rendering element not supported", ex);
}
}
示例4: RenderWidget
public override object RenderWidget (Widget widget)
{
var w = ((WidgetBackend)widget.GetBackend ()).Widget;
Gdk.Window win = w.GdkWindow;
if (win != null && win.IsViewable)
return new GtkImage (win.ToPixbuf (w.Allocation.X, w.Allocation.Y, w.Allocation.Width, w.Allocation.Height));
else
throw new InvalidOperationException ();
}
示例5: RenderWidget
public override object RenderWidget (Widget widget)
{
var w = ((WidgetBackend)widget.GetBackend ()).Widget;
Gdk.Window win = w.GdkWindow;
if (win != null && win.IsViewable) {
int ww, wh;
win.GetSize (out ww, out wh);
if (ww == w.Allocation.Width && wh == w.Allocation.Height)
return new GtkImage (win.ToPixbuf (0, 0, w.Allocation.Width, w.Allocation.Height));
return new GtkImage (win.ToPixbuf (w.Allocation.X, w.Allocation.Y, w.Allocation.Width, w.Allocation.Height));
}
throw new InvalidOperationException ();
}