Ejemplo n.º 1
0
        internal static void drawMemBltOrder()
        {
            int       x      = X;
            int       y      = Y;
            int       cX     = CX;
            int       cY     = CY;
            int       srcX   = SrcX;
            int       srcY   = SrcY;
            RdpBitmap bitmap = Cache.getBitmap(CacheID, CacheIDX);

            if (bitmap != null)
            {
                int boundsRight = (x + cX) - 1;
                if (boundsRight > Options.BoundsRight)
                {
                    boundsRight = Options.BoundsRight;
                }
                if (x < Options.BoundsLeft)
                {
                    x = Options.BoundsLeft;
                }
                cX = (boundsRight - x) + 1;
                int boundsBottom = (y + cY) - 1;
                if (boundsBottom > Options.BoundsBottom)
                {
                    boundsBottom = Options.BoundsBottom;
                }
                if (y < Options.BoundsTop)
                {
                    y = Options.BoundsTop;
                }
                cY    = (boundsBottom - y) + 1;
                srcX += x - X;
                srcY += y - Y;
                Options.Enter();
                try
                {
                    ChangedRect.Invalidate(x, y, cX, cY);
                    RasterOp.do_array(Opcode, Options.Canvas, Options.Canvas.Width, x, y, cX, cY, bitmap.getData(ColorTable), bitmap.getWidth(), srcX, srcY);
                }
                finally
                {
                    Options.Exit();
                }
            }
        }
Ejemplo n.º 2
0
        internal static void drawTriBltOrder()
        {
            int x           = X;
            int y           = Y;
            int cX          = CX;
            int cY          = CY;
            int srcX        = SrcX;
            int srcY        = SrcY;
            int boundsRight = (x + cX) - 1;

            if (boundsRight > Options.BoundsRight)
            {
                boundsRight = Options.BoundsRight;
            }
            if (x < Options.BoundsLeft)
            {
                x = Options.BoundsLeft;
            }
            cX = (boundsRight - x) + 1;
            int boundsBottom = (y + cY) - 1;

            if (boundsBottom > Options.BoundsBottom)
            {
                boundsBottom = Options.BoundsBottom;
            }
            if (y < Options.BoundsTop)
            {
                y = Options.BoundsTop;
            }
            cY    = (boundsBottom - y) + 1;
            srcX += x - X;
            srcY += y - Y;
            int fgcolor = RdpBitmap.convertColor(ForegroundColor);
            int bgcolor = RdpBitmap.convertColor(BackgroundColor);

            Options.Enter();
            try
            {
                RdpBitmap bitmap = Cache.getBitmap(CacheID, CacheIDX);
                if (bitmap != null)
                {
                    ChangedRect.Invalidate(x, y, cX, cY);
                    switch (Opcode)
                    {
                    case 0x69:
                        RasterOp.do_array(6, Options.Canvas, Options.Canvas.Width, x, y, cX, cY, bitmap.getData(ColorTable), bitmap.getWidth(), srcX, srcY);
                        PatBltOrder.drawPatBltOrder(9, x, y, cX, cY, fgcolor, bgcolor, Brush);
                        return;

                    case 0xb8:
                        PatBltOrder.drawPatBltOrder(6, x, y, cX, cY, fgcolor, bgcolor, Brush);
                        RasterOp.do_array(8, Options.Canvas, Options.Canvas.Width, x, y, cX, cY, bitmap.getData(ColorTable), bitmap.getWidth(), srcX, srcY);
                        PatBltOrder.drawPatBltOrder(6, x, y, cX, cY, fgcolor, bgcolor, Brush);
                        return;

                    case 0xc0:
                        RasterOp.do_array(12, Options.Canvas, Options.Canvas.Width, x, y, cX, cY, bitmap.getData(ColorTable), bitmap.getWidth(), srcX, srcY);
                        PatBltOrder.drawPatBltOrder(8, x, y, cX, cY, fgcolor, bgcolor, Brush);
                        return;
                    }
                    // Unimplemented Triblt opcode: Opcode
                    RasterOp.do_array(12, Options.Canvas, Options.Canvas.Width, x, y, cX, cY, bitmap.getData(ColorTable), bitmap.getWidth(), srcX, srcY);
                }
            }
            finally
            {
                Options.Exit();
            }
        }