Пример #1
0
        public override void Execute(SurfaceReceiver receiver)
        {
            int x, y;
            int tx, ty;
            int width, height;

            Gdk.Pixbuf      pixbuf;
            Gdk.Rectangle[] rects;
            Gdk.Rectangle   clippedRect;

            if (codecID != CODEC_ID_REMOTEFX)
            {
                return;
            }

            RfxMessage rfxMsg = receiver.rfx.ParseMessage(bitmapData, bitmapDataLength);

            x     = y = 0;
            width = height = 64;
            rects = new Gdk.Rectangle[rfxMsg.RectCount];

            int count = 0;

            while (rfxMsg.HasNextRect())
            {
                rfxMsg.GetNextRect(ref x, ref y, ref width, ref height);

                tx = x + destLeft;
                ty = y + destTop;

                rects[count++] = new Gdk.Rectangle(tx, ty, width, height);
            }

            while (rfxMsg.HasNextTile())
            {
                rfxMsg.GetNextTile(buffer, ref x, ref y);

                tx = x + destLeft;
                ty = y + destTop;

                Gdk.Rectangle tileRect = new Gdk.Rectangle(tx, ty, 64, 64);

                foreach (Gdk.Rectangle rect in rects)
                {
                    rect.Intersect(tileRect, out clippedRect);

                    if (!clippedRect.IsEmpty)
                    {
                        pixbuf = new Gdk.Pixbuf(buffer, Gdk.Colorspace.Rgb, true, 8, 64, 64, 64 * 4);

                        pixbuf.CopyArea(0, 0, clippedRect.Width, clippedRect.Height,
                                        receiver.surface, clippedRect.X, clippedRect.Y);

                        receiver.InvalidateRect(clippedRect.X, clippedRect.Y, clippedRect.Width, clippedRect.Height);
                    }
                }
            }
        }
Пример #2
0
        public static RfxMessage Parse(IntPtr rfxHandle, byte[] data, UInt32 length)
        {
            IntPtr msgHandle;

            msgHandle = rfx_process_message(rfxHandle, data, length);
            RfxMessage message = new RfxMessage(rfxHandle, msgHandle);

            message.ntiles = rfx_message_get_tile_count(msgHandle);
            message.nrects = rfx_message_get_rect_count(msgHandle);

            return message;
        }
Пример #3
0
        public static RfxMessage Parse(IntPtr rfxHandle, byte[] data, UInt32 length)
        {
            IntPtr msgHandle;

            msgHandle = rfx_process_message(rfxHandle, data, length);
            RfxMessage message = new RfxMessage(rfxHandle, msgHandle);

            message.ntiles = rfx_message_get_tile_count(msgHandle);
            message.nrects = rfx_message_get_rect_count(msgHandle);

            return(message);
        }
Пример #4
0
 public RfxMessage ParseMessage(byte[] data, UInt32 length)
 {
     return(RfxMessage.Parse(handle, data, length));
 }