コード例 #1
0
        internal static void drawScreenBltOrder(int x, int y, int cx, int cy, int SrcX, int SrcY, int Opcode)
        {
            int num         = x;
            int num2        = y;
            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;
            int srcx = (SrcX + x) - num;
            int srcy = (SrcY + y) - num2;

            // ScreenBltOrder
            ChangedRect.Invalidate(x, y, cx, cy);
            RasterOp.do_array(Opcode, Options.Canvas, Options.Canvas.Width, x, y, cx, cy, null, Options.Canvas.Width, srcx, srcy);
        }
コード例 #2
0
ファイル: DestBltOrder.cs プロジェクト: najachai/RDPUploader
        internal static void drawDestBltOrder(int x, int y, int cx, int cy, int Opcode)
        {
            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;
            ChangedRect.Invalidate(x, x, cx, cy);
            RasterOp.do_array(Opcode, Options.Canvas, Options.Canvas.Width, x, y, cx, cy, null, 0, 0, 0);
        }
コード例 #3
0
ファイル: LineOrder.cs プロジェクト: najachai/RDPUploader
        private static void setPixel(int opcode, int x, int y, int color)
        {
            int bpp = Options.Bpp;

            if ((((x >= Options.BoundsLeft) && (x <= Options.BoundsRight)) && (y >= Options.BoundsTop)) && (y <= Options.BoundsBottom))
            {
                RasterOp.do_pixel(opcode, Options.Canvas, x, y, color);
            }
        }
コード例 #4
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();
                }
            }
        }
コード例 #5
0
        internal static void drawPatBltOrder(int opcode, int x, int y, int cx, int cy, int fgcolor, int bgcolor, BrushOrder brush)
        {
            int num3;
            int boundsRight = (x + cx) - 1;

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

            if (boundsBottom > Options.BoundsBottom)
            {
                boundsBottom = Options.BoundsBottom;
            }
            if (y > Options.BoundsBottom)
            {
                y = Options.BoundsBottom;
            }
            if (y < Options.BoundsTop)
            {
                y = Options.BoundsTop;
            }
            cy = (boundsBottom - y) + 1;
            if (cy < 0)
            {
                cy = 0;
            }
            ChangedRect.Invalidate(x, y, cx, cy);
            uint[] src = null;
            switch (Brush.Style)
            {
            case 0:
                src = new uint[cx * cy];
                for (num3 = 0; num3 < src.Length; num3++)
                {
                    src[num3] = (uint)fgcolor;
                }
                RasterOp.do_array(opcode, Options.Canvas, Options.Canvas.Width, x, y, cx, cy, src, cx, 0, 0);
                break;

            case 1:
            case 2:
                break;

            case 3:
            {
                int    xOrigin = Brush.XOrigin;
                int    yOrigin = Brush.YOrigin;
                byte[] pattern = Brush.Pattern;
                src = new uint[cx * cy];
                int index = 0;
                for (num3 = 0; num3 < cy; num3++)
                {
                    for (int i = 0; i < cx; i++)
                    {
                        if ((pattern[(num3 + yOrigin) % 8] & (((int)1) << ((i + xOrigin) % 8))) == 0)
                        {
                            src[index] = (uint)fgcolor;
                        }
                        else
                        {
                            src[index] = (uint)bgcolor;
                        }
                        index++;
                    }
                }
                RasterOp.do_array(opcode, Options.Canvas, Options.Canvas.Width, x, y, cx, cy, src, cx, 0, 0);
                return;
            }

            default:
                return;
            }
        }
コード例 #6
0
ファイル: LineOrder.cs プロジェクト: najachai/RDPUploader
        internal static void drawLineVerticalHorizontal(int x1, int y1, int x2, int y2, int color, int opcode)
        {
            int num;
            int num2;

            if (y1 == y2)
            {
                if ((y1 >= Options.BoundsTop) && (y1 <= Options.BoundsBottom))
                {
                    if (x2 > x1)
                    {
                        if (x1 < Options.BoundsLeft)
                        {
                            x1 = Options.BoundsLeft;
                        }
                        if (x2 > Options.BoundsRight)
                        {
                            x2 = Options.BoundsRight;
                        }
                        num = (y1 * Options.Canvas.Width) + x1;
                        ChangedRect.Invalidate(x1, y1, x2 - x1, 1);
                        for (num2 = 0; num2 < (x2 - x1); num2++)
                        {
                            RasterOp.do_pixel(opcode, Options.Canvas, x1 + num2, y1, color);
                            num++;
                        }
                    }
                    else
                    {
                        if (x2 < Options.BoundsLeft)
                        {
                            x2 = Options.BoundsLeft;
                        }
                        if (x1 > Options.BoundsRight)
                        {
                            x1 = Options.BoundsRight;
                        }
                        num = (y1 * Options.Canvas.Width) + x1;
                        ChangedRect.Invalidate(x2, y1, x1 - x2, 1);
                        for (num2 = 0; num2 < (x1 - x2); num2++)
                        {
                            RasterOp.do_pixel(opcode, Options.Canvas, x2 + num2, y1, color);
                            num--;
                        }
                    }
                }
            }
            else if ((x1 >= Options.BoundsLeft) && (x1 <= Options.BoundsRight))
            {
                if (y2 > y1)
                {
                    if (y1 < Options.BoundsTop)
                    {
                        y1 = Options.BoundsTop;
                    }
                    if (y2 > Options.BoundsBottom)
                    {
                        y2 = Options.BoundsBottom;
                    }
                    num = (y1 * Options.Canvas.Width) + x1;
                    ChangedRect.Invalidate(x1, y1, 1, y2 - y1);
                    for (num2 = 0; num2 < (y2 - y1); num2++)
                    {
                        RasterOp.do_pixel(opcode, Options.Canvas, x1, y1 + num2, color);
                        num += Options.Canvas.Width;
                    }
                }
                else
                {
                    if (y2 < Options.BoundsTop)
                    {
                        y2 = Options.BoundsTop;
                    }
                    if (y1 > Options.BoundsBottom)
                    {
                        y1 = Options.BoundsBottom;
                    }
                    num = (y1 * Options.Canvas.Width) + x1;
                    ChangedRect.Invalidate(x1, y2, 1, y1 - y2);
                    for (num2 = 0; num2 < (y1 - y2); num2++)
                    {
                        RasterOp.do_pixel(opcode, Options.Canvas, x1, y2 + num2, color);
                        num -= Options.Canvas.Width;
                    }
                }
            }
        }
コード例 #7
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();
            }
        }