Ejemplo n.º 1
0
        private void CreatePixmaps()
        {
            GCValues shapeGCV;

            //Create a 1 depth pixmap used as a shape
            //that will contain the info about transparency
            shape    = new Pixmap(null, Gdk.Screen.Default.Width, Gdk.Screen.Default.Height, 1);
            shapeGC  = new Gdk.GC(shape);
            shapeGCV = new GCValues();
            shapeGC.GetValues(shapeGCV);
            transparent        = shapeGCV.Foreground;
            opaque             = shapeGCV.Background;
            shapeGC.Foreground = transparent;
            shape.DrawRectangle(shapeGC, true, 0, 0, Gdk.Screen.Default.Width, Gdk.Screen.Default.Height);
            shapeGC.Background = opaque;

            ShapeCombineMask(shape, 0, 0);

            //Create the pixmap that will contain the real drawing
            //Used on Expose event to redraw the drawing area
            pixmap = new Pixmap(drawingarea.GdkWindow, Gdk.Screen.Default.Width, Gdk.Screen.Default.Height);
            pixmap.DrawRectangle(drawingarea.Style.BlackGC, true, 0, 0, Gdk.Screen.Default.Width, Gdk.Screen.Default.Height);
        }
Ejemplo n.º 2
0
        private void CreatePixmaps()
        {
            GCValues shapeGCV;

            //Create a 1 depth pixmap used as a shape
            //that will contain the info about transparency
            shape = new Pixmap (null, Gdk.Screen.Default.Width, Gdk.Screen.Default.Height, 1);
            shapeGC = new Gdk.GC (shape);
            shapeGCV = new GCValues ();
            shapeGC.GetValues (shapeGCV);
            transparent = shapeGCV.Foreground;
            opaque = shapeGCV.Background;
            shapeGC.Foreground = transparent;
            shape.DrawRectangle (shapeGC, true, 0, 0, Gdk.Screen.Default.Width, Gdk.Screen.Default.Height);
            shapeGC.Background = opaque;

            ShapeCombineMask (shape, 0, 0);

            //Create the pixmap that will contain the real drawing
            //Used on Expose event to redraw the drawing area
            pixmap = new Pixmap (drawingarea.GdkWindow, Gdk.Screen.Default.Width, Gdk.Screen.Default.Height);
            pixmap.DrawRectangle (drawingarea.Style.BlackGC, true, 0, 0, Gdk.Screen.Default.Width, Gdk.Screen.Default.Height);
        }