当前位置: 首页>>代码示例>>C#>>正文


C# BufferChunk.NextInt32方法代码示例

本文整理汇总了C#中NewTOAPIA.BufferChunk.NextInt32方法的典型用法代码示例。如果您正苦于以下问题:C# BufferChunk.NextInt32方法的具体用法?C# BufferChunk.NextInt32怎么用?C# BufferChunk.NextInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NewTOAPIA.BufferChunk的用法示例。


在下文中一共展示了BufferChunk.NextInt32方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReceiveChunk

        public virtual void ReceiveChunk(BufferChunk aRecord)
        {
            // First read out the record type
            int recordType = aRecord.NextInt32();

            // Then deserialize the rest from there
            switch ((UserIOCommand)recordType)
            {
                case UserIOCommand.HideCursor:
                    HideCursor();
                    break;

                case UserIOCommand.Showcursor:
                    ShowCursor();
                    break;

                case UserIOCommand.MoveCursor:
                    {
                        int x = aRecord.NextInt32();
                        int y = aRecord.NextInt32();

                        MoveCursor(x, y);
                    }
                    break;

                case UserIOCommand.KeyboardActivity:
                    {
                        KeyActivityType kEvent = (KeyActivityType)aRecord.NextInt32();
                        VirtualKeyCodes vk = (VirtualKeyCodes)aRecord.NextInt32();

                        KeyboardActivityArgs kbda = new KeyboardActivityArgs(kEvent, vk);
                        KeyboardActivity(this, kbda); 
                    }
                    break;

                case UserIOCommand.MouseActivity:
                    {
                        MouseActivityType maType = MouseActivityType.None;
                        MouseButtonActivity mbActivity = (MouseButtonActivity)aRecord.NextInt32();
                        int x = aRecord.NextInt32();
                        int y = aRecord.NextInt32();
                        int clicks = aRecord.NextInt32();
                        short delta = aRecord.NextInt16();
                        int keyflags = 0;

                        MouseActivityArgs ma = new MouseActivityArgs(null, maType, mbActivity, 
                            MouseCoordinateSpace.Desktop, MouseMovementType.Absolute, IntPtr.Zero, 
                            x, y, delta, clicks, keyflags);

                        MouseActivity(this, ma);
                    }
                    break;

                default:
                    break;
            }
        }
开发者ID:Wiladams,项目名称:NewTOAPIA,代码行数:57,代码来源:UserIOChannelDecoder.cs

示例2: UnpackPoints

    Point[] UnpackPoints(BufferChunk chunk)
    {
        // Need to know how many points so that space can be allocated for them on the receiving end
        int numPoints = chunk.NextInt32();

        // Allocate a points array of the right size
        Point[] points = new Point[numPoints];

        // Encode each of the points
        for (int i = 0; i < numPoints; i++)
        {
            points[i].x = chunk.NextInt32();
            points[i].y = chunk.NextInt32();
        }

        return points;
    }
开发者ID:Wiladams,项目名称:NewTOAPIA,代码行数:17,代码来源:GraphPortChunkDecoder.cs

示例3: UnpackGuid

    Guid UnpackGuid(BufferChunk chunk)
    {
        int bufferLength = chunk.NextInt32(); // How many bytes did we pack
        byte[] bytes = (byte[])chunk.NextBufferChunk(bufferLength);
        Guid aGuid = new Guid(bytes);

        return aGuid;
    }
开发者ID:Wiladams,项目名称:NewTOAPIA,代码行数:8,代码来源:GraphPortChunkDecoder.cs

示例4: UnpackTRIVERTEX

    TRIVERTEX[] UnpackTRIVERTEX(BufferChunk chunk)
    {
        int nVertices = chunk.NextInt32();

        TRIVERTEX[] pVertex = new TRIVERTEX[nVertices];

        // Pack the vertices, starting with the length
        for (int i = 0; i < nVertices; i++)
        {
            pVertex[i].x = chunk.NextInt32();
            pVertex[i].y = chunk.NextInt32();
            pVertex[i].Alpha = chunk.NextUInt16();
            pVertex[i].Blue = chunk.NextUInt16();
            pVertex[i].Green = chunk.NextUInt16();
            pVertex[i].Red = chunk.NextUInt16();
        }

        return pVertex;
    }
开发者ID:Wiladams,项目名称:NewTOAPIA,代码行数:19,代码来源:GraphPortChunkDecoder.cs

示例5: UnpackGRADIENT_RECT

    GRADIENT_RECT[] UnpackGRADIENT_RECT(BufferChunk chunk)
    {
        int nRects = chunk.NextInt32();

        GRADIENT_RECT[] pMesh = new GRADIENT_RECT[nRects];

        for (int i = 0; i < nRects; i++)
        {
            pMesh[i].UpperLeft = chunk.NextUInt32();
            pMesh[i].LowerRight = chunk.NextUInt32();
        }

        return pMesh;
    }
开发者ID:Wiladams,项目名称:NewTOAPIA,代码行数:14,代码来源:GraphPortChunkDecoder.cs

示例6: ReceiveChunk

        public virtual void ReceiveChunk(BufferChunk aRecord)
        {
            // First read out the record type
            int recordType = aRecord.NextInt32();

            // Then deserialize the rest from there
            switch (recordType)
            {

                //case (int)UICommands.PixBlt:
                //    {
                //        // Get the X, Y
                //        int x = aRecord.NextInt32();
                //        int y = aRecord.NextInt32();

                //        // get the length of the image bytes buffer
                //        int dataSize = aRecord.NextInt32();

                //        byte[] imageBytes = (byte[])aRecord;

                //        // Create a memory stream from the imageBytes
                //        MemoryStream ms = new MemoryStream(imageBytes, false);

                //        // Create a pixelArray from the stream
                //        Bitmap bm = (Bitmap)Bitmap.FromStream(ms);

                //        PixelArray<BGRAb> pixMap = PixelBufferHelper.CreatePixelArrayFromBitmap(bm);
                        
                //        // And finally, call the PixBlt function
                //        PixBltBGRAb(pixMap, x, y);
                //    }
                //    break;

                case (int)UICommands.PixBltRLE:
                    {
                        // Get the X, Y
                        int x = aRecord.NextInt32();
                        int y = aRecord.NextInt32();
                        int width = aRecord.NextInt32();
                        int height = aRecord.NextInt32();

                        // get the length of the image bytes buffer
                        int dataSize = aRecord.NextInt32();

                        byte[] imageBytes = (byte[])aRecord;

                        // Create a memory stream from the imageBytes
                        MemoryStream ms = new MemoryStream(imageBytes, false);

                        // Create a pixelArray from the stream
                        if ((width != fPixMap.Width) || (height != fPixMap.Height))
                            fPixMap = new GDIDIBSection(width, height);

                        TargaRunLengthCodec rlc = new TargaRunLengthCodec();
                        PixelAccessorBGRb accessor = new PixelAccessorBGRb(fPixMap.Width, fPixMap.Height, fPixMap.Orientation, fPixMap.Pixels, fPixMap.BytesPerRow);
                        rlc.Decode(ms, accessor);

                        // And finally, call the local PixBlt function
                        PixBltPixelBuffer24(fPixMap, x, y);
                    }
                    break;

                case (int)UICommands.PixBltLuminance:
                    {
                        // Get the X, Y
                        int x = aRecord.NextInt32();
                        int y = aRecord.NextInt32();
                        int width = aRecord.NextInt32();
                        int height = aRecord.NextInt32();

                        // get the length of the image bytes buffer
                        int dataSize = aRecord.NextInt32();

                        byte[] imageBytes = (byte[])aRecord;

                        // Create a memory stream from the imageBytes
                        MemoryStream ms = new MemoryStream(imageBytes, false);

                        // Create a pixelArray from the stream
                        if ((width != fGrayImage.Width) || (height != fGrayImage.Height))
                            fGrayImage = new PixelArray<Lumb>(width, height);

                        TargaLuminanceRLE rlc = new TargaLuminanceRLE();
                        rlc.Decode(ms, fGrayImage);

                        // And finally, call the local PixBlt function
                        PixBltLumb(fGrayImage, x, y);
                    }
                    break;

                case (int)UICommands.Showcursor:
                    {
                        ShowCursor();
                    }
                    break;

                case (int)UICommands.HideCursor:
                    {
                        HideCursor();
                    }
//.........这里部分代码省略.........
开发者ID:Wiladams,项目名称:NewTOAPIA,代码行数:101,代码来源:GraphPortChunkDecoder.cs

示例7: ReceiveData

        public virtual void ReceiveData(BufferChunk aRecord)
        {
            // First read out the record type
            int recordType = aRecord.NextInt32();

            Console.WriteLine("SpaceCommandDecoder.ReceiveData: {0}", recordType);

            switch (recordType)
            {
                case SpaceControlChannel.SC_CreateSurface:
                    {
                        Guid uniqueID = CodecUtils.UnpackGuid(aRecord);
                        int x = aRecord.NextInt32();
                        int y = aRecord.NextInt32();
                        int width = aRecord.NextInt32();
                        int height = aRecord.NextInt32();

                        OnCreateSurface("title",new RECT(x,y,width,height), uniqueID);
                    }
                    break;

                case SpaceControlChannel.SC_InvalidateSurfaceRect:
                    {
                        Guid uniqueID = CodecUtils.UnpackGuid(aRecord);
                        int x = aRecord.NextInt32();
                        int y = aRecord.NextInt32();
                        int width = aRecord.NextInt32();
                        int height = aRecord.NextInt32();

                        OnInvalidateSurfaceRect(uniqueID, new RECT(x, y, width, height));
                    }
                    break;

                case SpaceControlChannel.SC_MouseEvent:
                    {
                        Guid sourceID = CodecUtils.UnpackGuid(aRecord);
                        uint mouseID = aRecord.NextUInt32();
                        MouseEventType eventType = (MouseEventType)aRecord.NextInt32();
                        MouseButtons buttons = (MouseButtons)aRecord.NextInt32();
                        int x = aRecord.NextInt32();
                        int y = aRecord.NextInt32();
                        int clicks = aRecord.NextInt32();
                        int delta = aRecord.NextInt32();

                        MouseEventArgs args = new MouseEventArgs(mouseID, eventType, buttons, clicks, x, y, delta, sourceID);
                        
                        OnMouseActivity(this, args);
                    }
                    break;

                case SpaceControlChannel.SC_KeyboardEvent:
                    break;

                //case SpaceControlChannel.SC_BitBlt:
                //  {
                //    // Get the X, Y
                //    int x = aRecord.NextInt32();
                //    int y = aRecord.NextInt32();
                //    int width = aRecord.NextInt32();
                //    int height = aRecord.NextInt32();

                //    // Now create a pixbuff on the specified size
                //    PixelBuffer pixBuff = new PixelBuffer(width, height);
                //    int dataSize = aRecord.NextInt32();

                //    // Copy the received data into it right pixel data pointer
                //    aRecord.CopyTo(pixBuff.Pixels.Data, dataSize);

                //    // And finally, call the BitBlt function
                //    OnBitBlt(x,y,pixBuff);
                //}
                //  break;

                case SpaceControlChannel.SC_CopyPixels:
                  {
                      // Get the X, Y
                      int x = aRecord.NextInt32();
                      int y = aRecord.NextInt32();
                      int width = aRecord.NextInt32();
                      int height = aRecord.NextInt32();

                      // Now create a pixbuff on the specified size
                      PixelBuffer pixBuff = new PixelBuffer(width, height);
                      int dataSize = aRecord.NextInt32();

                      // Copy the received data into it right pixel data pointer
                      aRecord.CopyTo(pixBuff.Pixels.Data, dataSize);

                      // And finally, call the BitBlt function
                      OnCopyPixels(x, y, width, height, pixBuff);
                  }
                  break;

                case SpaceControlChannel.SC_AlphaBlend:
                {
                    // Get the X, Y
                    int x = aRecord.NextInt32();
                    int y = aRecord.NextInt32();
                    int width = aRecord.NextInt32();
                    int height = aRecord.NextInt32();
//.........这里部分代码省略.........
开发者ID:Wiladams,项目名称:NewTOAPIA,代码行数:101,代码来源:SpaceCommandDecoder.cs

示例8: ReceiveData

    public virtual void ReceiveData(BufferChunk aRecord)
    {
        // First read out the record type
        int recordType = aRecord.NextInt32();

        // Then deserialize the rest from there
        switch (recordType)
        {
            case GDI32.EMR_HEADER:
                break;

            // Transform related
            case GDI32.EMR_SCALEVIEWPORTEXTEX:
            case GDI32.EMR_SCALEWINDOWEXTEX:
                break;

            case GDI32.EMR_SETWINDOWEXTEX:
                {
                    int width = aRecord.NextInt32();
                    int height = aRecord.NextInt32();

                    SetWindowExtent(width, height);
                }
                break;

            case GDI32.EMR_SETWINDOWORGEX:
                {
                    int x = aRecord.NextInt32();
                    int y = aRecord.NextInt32();

                    SetWindowOrigin(x, y);
                }
                break;

            case GDI32.EMR_SETVIEWPORTEXTEX:
                {
                    int width = aRecord.NextInt32();
                    int height = aRecord.NextInt32();

                    SetViewportExtent(width, height);
                }
                break;

            case GDI32.EMR_SETVIEWPORTORGEX:
                {
                    int x = aRecord.NextInt32();
                    int y = aRecord.NextInt32();
                    
                    SetViewportOrigin(x, y);
                }
                break;

            case GDI32.EMR_SETWORLDTRANSFORM:
            case GDI32.EMR_MODIFYWORLDTRANSFORM:
                break;

            case GDI32.EMR_SETBRUSHORGEX:
                break;

            case GDI32.EMR_EOF:
                Flush();
                break;

            case GDI32.EMR_SETPIXELV:
                {
                    int x = aRecord.NextInt32();
                    int y = aRecord.NextInt32();
                    UInt32 colorref = aRecord.NextUInt32();

                    SetPixel(x, y, colorref);
                }
                break;

            case GDI32.EMR_SETMAPPERFLAGS:
                break;

            case GDI32.EMR_SETPOLYFILLMODE:
                SetPolyFillMode(aRecord.NextInt32());
                break;

            case GDI32.EMR_SETSTRETCHBLTMODE:
                break;

            case GDI32.EMR_SETMAPMODE:
                MappingModes aMode = (MappingModes)aRecord.NextInt32();
                SetMappingMode(aMode);
                break;


            case GDI32.EMR_SETTEXTCOLOR:
                SetTextColor(aRecord.NextUInt32());
                break;

            case GDI32.EMR_SETBKCOLOR:
                SetBkColor(aRecord.NextUInt32());
                break;

            case GDI32.EMR_SETDCBRUSHCOLOR:
                SetDefaultBrushColor(aRecord.NextUInt32());
                break;
//.........这里部分代码省略.........
开发者ID:Wiladams,项目名称:NewTOAPIA,代码行数:101,代码来源:GraphPortChunkDecoder.cs

示例9: UnpackGPen

        public static GDIPen UnpackGPen(BufferChunk chunk)
        {
            uint penColor;
            PenStyle penStyle;
            Guid uniqueID;
            int penSize;

            penStyle = (PenStyle)chunk.NextInt32();
            penSize = chunk.NextInt32();
            penColor = chunk.NextUInt32();
            uniqueID = UnpackGuid(chunk);

            GDIPen aPen = new GDIPen(PenType.Cosmetic, PenStyle.Solid, PenJoinStyle.Round, PenEndCap.Round, penColor, penSize, uniqueID);
            return aPen;            
        }
开发者ID:Wiladams,项目名称:NewTOAPIA,代码行数:15,代码来源:ChunkUtils.cs


注:本文中的NewTOAPIA.BufferChunk.NextInt32方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。