Advertisement
rotrevrep

load pixbuf from resource

Jun 30th, 2015
612
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. using System;
  2. using System.Reflection;
  3. using System.IO;
  4.  
  5. using Gtk;
  6.  
  7. namespace tito
  8. {
  9.     class MainClass
  10.     {
  11.         public static void Main (string[] args)
  12.         {
  13.             Application.Init ();
  14.             MainWindow win = new MainWindow ();
  15.             Assembly assembly = Assembly.GetExecutingAssembly ();
  16.             var stream = assembly.GetManifestResourceStream ("image.png");
  17.             var img = new Gtk.Image (stream);
  18.             win.Add (img);
  19.             win.Show ();
  20.             Application.Run ();
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement