diff options
author | Lluis Sanchez <lluis@xamarin.com> | 2013-07-03 22:24:35 +0400 |
---|---|---|
committer | Lluis Sanchez <lluis@xamarin.com> | 2013-07-03 22:24:35 +0400 |
commit | 3931e365fe48085ce0decc6cabd96a8e06c3c171 (patch) | |
tree | 950d5495070f43157f42ba5f617319479986708c /Xwt.Gtk/Xwt.GtkBackend/GtkEngine.cs | |
parent | e355958bc165dcc4d8a2ff770be180ad78f65648 (diff) |
Add support for rendering images into a native surface object
Diffstat (limited to 'Xwt.Gtk/Xwt.GtkBackend/GtkEngine.cs')
-rwxr-xr-x | Xwt.Gtk/Xwt.GtkBackend/GtkEngine.cs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Xwt.Gtk/Xwt.GtkBackend/GtkEngine.cs b/Xwt.Gtk/Xwt.GtkBackend/GtkEngine.cs index 5f4fef62..e4aae705 100755 --- a/Xwt.Gtk/Xwt.GtkBackend/GtkEngine.cs +++ b/Xwt.Gtk/Xwt.GtkBackend/GtkEngine.cs @@ -259,6 +259,15 @@ namespace Xwt.GtkBackend else throw new InvalidOperationException (); } + + public override void RenderImage (object nativeWidget, object nativeContext, ImageDescription img, double x, double y) + { + GtkImage gim = (GtkImage)img.Backend; + Cairo.Context ctx = nativeContext as Cairo.Context; + Gtk.Widget w = (Gtk.Widget)nativeWidget; + if (ctx != null) + gim.Draw (ApplicationContext, ctx, Util.GetScaleFactor (w), x, y, img); + } } public interface IGtkContainer |