コード例 #1
0
ファイル: GtkBitmap.cs プロジェクト: williammc/sentience
 /// <summary>
 /// load bitmap data from file
 /// </summary>
 public static byte[] Load(String filename,
                           ref int image_width, ref int image_height)
 {
     if (File.Exists(filename))
     {
         sluggish.utilities.gtk.Image img = new sluggish.utilities.gtk.Image(filename);
         Gdk.Pixbuf buffer = img.MakePixbufFromCompressedData();
         image_width  = img.Width;
         image_height = img.Height;
         byte[] bmp = new byte[img.Width * img.Height * 3];
         getBitmap(buffer, bmp);
         return(bmp);
     }
     else
     {
         return(null);
     }
 }
コード例 #2
0
ファイル: GtkBitmap.cs プロジェクト: kasertim/sentience
		/// <summary> 
		/// load bitmap data from file
		/// </summary>
		public static byte[] Load(string filename, 
		                          ref int image_width, ref int image_height)
		{
		    if (File.Exists(filename))
		    {
		        sluggish.utilities.gtk.Image img = new sluggish.utilities.gtk.Image(filename);
		        Gdk.Pixbuf buffer = img.MakePixbufFromCompressedData();
		        image_width = img.Width;
		        image_height = img.Height;
		        byte[] bmp = new byte[img.Width * img.Height * 3];
		        getBitmap(buffer, bmp);		    
		        return(bmp);
		    }
		    else
		        return(null);
		}