QSWidgetLib.ImageViewer.OnExposeEvent C# (CSharp) Method

OnExposeEvent() protected method

protected OnExposeEvent ( Gdk e ) : bool
e Gdk
return bool
        protected override bool OnExposeEvent(Gdk.EventExpose e)
        {
            if (ResizedPixbuf == null)
                return false;
            logger.Debug("Explose w={0}, h={1}", this.Allocation.Width, this.Allocation.Height) ;
            int dest_x = this.Allocation.Width > ResizedPixbuf.Width ? (Allocation.Width - ResizedPixbuf.Width) / 2 : 0;
            int dest_y = this.Allocation.Height > ResizedPixbuf.Height ? (Allocation.Height - ResizedPixbuf.Height) / 2 : 0;
            e.Window.DrawPixbuf(this.Style.BackgroundGC(State), ResizedPixbuf, 0, 0, dest_x, dest_y, -1, -1, RgbDither.None, 0, 0);

            return true;
        }