예제 #1
0
        // ###############################################################################
        // ### M E T H O D S
        // ###############################################################################

        #region Methods

        /// <summary> Draw the image in the indicated window, using the indicated graphics context. </summary>
        /// <param name="window"> The window to draw the pitmap on. <see cref="System.IntPtr"/> </param>
        /// <param name="gc"> The crapchics context to use for drawing. <see cref="System.IntPtr"/> </param>
        /// <param name="destX"> The x coordinate, which is relative to the origin of the window and is the coordinate of the subimage. <see cref="TInt"/> </param>
        /// <param name="destY"> The y coordinate, which is relative to the origin of the window and is the coordinate of the subimage. <see cref="TInt"/> </param>
        private void DrawUnfinished(IntPtr window, IntPtr gc, TInt dstX, TInt dstY)
        {
            // This is an alternative drawing approach, but i didn't get it working.
            IntPtr clipPixmap = X11lib.XCreatePixmap(_display, window, (TUint)_width, (TUint)_height, (TUint)_clipDepth);
            IntPtr clipGc     = X11lib.XCreateGC(_display, clipPixmap, (TUlong)0, IntPtr.Zero);

            X11lib.XPutImage(_display, clipPixmap, clipGc, _transpXImage, (TInt)0, (TInt)0, (TInt)0, (TInt)0, (TUint)_width, (TUint)_height);

            X11lib.XSetFunction(_display, gc, X11lib.XGCFunction.GXand);
            X11lib.XSetBackground(_display, gc, (TPixel)1);
            X11lib.XSetForeground(_display, gc, (TPixel)0);

            X11lib.XCopyPlane(_display, clipPixmap, window, gc, (TInt)0, (TInt)0, (TUint)_width, (TUint)_height, (TInt)dstX, (TInt)dstY, (TUlong)1);
        }