[Gtk-sharp-list] Image resize on image widget control

dkarantonis dkarantonis at soft4real.com
Wed Dec 16 11:18:12 EST 2009


Yes,
both your code examples worked!

thanks


Andrew York-2 wrote:
> 
> Use the Gdk.Pixbuf to resize the images like this:
> 
> img.Pixbuf.ScaleSimple(50,150, Gdk.InterpType.Nearest);
> or when you declare the new Pixbuf you can resize it.
> 
> I have found this method the easiest way to get Pixbuf from a resource,
> this assumes the resource is the current assemble of course.
> Gdk.Pixbuf.LoadFromResource("resourceImageId");
> 
> 
> I hope this helps.
> 
> SpoodyGoon
> 
> 
> 
> On 12/15/2009 3:37 AM, dkarantonis wrote:
>> Hi,
>> i would like to ask how i could resize an image from the project
>> resources
>> inside an image widget control.
>>
>> What i am doing for the moment is loading the image and try to resize it
>> by
>> assigning hard coded width and height values, but the image does not
>> render
>> with the specified width and height but with its original values.
>>
>> //create image from resource
>> Image img = new Image (myAssembly, "resourceImageId");
>>
>> //resize image
>> img.WidthRequest = 50;
>> img.HeightRequest = 150;
>>
>> //assign image to image widget
>> imgControl.PixBuf = img.PixBuf();
>>
>> Any ideas?
>>
>> thanks in advance
>>    
> 
> 
> 
> 
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
> 
> 

-- 
View this message in context: http://old.nabble.com/Image-resize-on-image-widget-control-tp26791414p26813846.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.



More information about the Gtk-sharp-list mailing list