static public Pixbuf LoadAtMaxSize(string path, int max_width, int max_height)
    {
#if true
        PixbufUtils.AspectLoader loader = new AspectLoader(max_width, max_height);
        return(loader.LoadFromFile(path));
#else
        int width, height;
        JpegUtils.GetSize(path, out width, out height);
        PixbufUtils.Fit(width, height, max_width, max_height, false, out width, out height);
        Gdk.Pixbuf image = JpegUtils.LoadScaled(path, width, height);

        return(image);
#endif
    }
Ejemplo n.º 2
0
        public void Get_Generic_Type_Of_a_Generic_List()
        {
            // Arrange
            var aspectLoader = new AspectLoader();
            var type         = aspectLoader.GetType();
            var methodInfo   = type.GetMethods().First();

            // Act
            var returnType      = methodInfo.ReturnType;
            var returnParameter = methodInfo.ReturnParameter;

            // Assert
            Assert.IsNotNull(returnType);
            Assert.IsNotNull(returnParameter);
        }
Ejemplo n.º 3
0
	static public Pixbuf LoadAtMaxSize (string path, int max_width, int max_height)
	{
#if true
		PixbufUtils.AspectLoader loader = new AspectLoader (max_width, max_height);
		return loader.LoadFromFile (path);
#else
		int width, height;
		JpegUtils.GetSize (path, out width, out height);
		PixbufUtils.Fit (width, height, max_width, max_height, false, out width, out height);
		Gdk.Pixbuf image = JpegUtils.LoadScaled (path, width, height);
		
		return image;
#endif
	}
Ejemplo n.º 4
0
 public static Pixbuf LoadAtMaxSize(string path, int max_width, int max_height)
 {
     PixbufUtils.AspectLoader loader = new AspectLoader (max_width, max_height);
     return loader.LoadFromFile (path);
 }
Ejemplo n.º 5
0
 static public Pixbuf LoadAtMaxSize(string path, int max_width, int max_height)
 {
     PixbufUtils.AspectLoader loader = new AspectLoader(max_width, max_height);
     return(loader.LoadFromFile(path));
 }