[Gtk-sharp-list] Scale a pixmap

farolfo farolfo at hotmail.com
Thu Feb 11 10:30:43 EST 2010




farolfo wrote:
> 
> I'm making a graphic application and I need to draw a pixmap. There is a
> way with gtk# to resize this kind of object ?
> 

I have resolve with this function:

public Pixmap StrechScreen(Pixmap InPixmap, ref Gdk.GC GraphicContest)
    {
       
        Pixbuf MyPixbuf = Pixbuf.FromDrawable(InPixmap, InPixmap.Colormap,
0, 0, 0, 0, ScreenRectangle.Width, ScreenRectangle.Height);

        Pixbuf NewBuffer = new Pixbuf(MyPixbuf.ScaleSimple(SWidth, SHeight,
InterpType.Bilinear), 0, 0, SWidth, SHeight);
       
        Pixmap buffer = new Pixmap(Projector.GdkWindow, SWidth, SHeight);
       
       buffer.DrawPixbuf(GraphicContest, NewBuffer, 0, 0, 0, 0, SWidth,
SHeight, RgbDither.Normal, 0,
       0);
      
          
       return buffer;
   }






-- 
View this message in context: http://old.nabble.com/Scale-a-pixmap-tp27474898p27547743.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.



More information about the Gtk-sharp-list mailing list