當前位置: 首頁>>代碼示例>>C#>>正文


C# BufferChunk.NextUInt32方法代碼示例

本文整理匯總了C#中NewTOAPIA.BufferChunk.NextUInt32方法的典型用法代碼示例。如果您正苦於以下問題:C# BufferChunk.NextUInt32方法的具體用法?C# BufferChunk.NextUInt32怎麽用?C# BufferChunk.NextUInt32使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在NewTOAPIA.BufferChunk的用法示例。


在下文中一共展示了BufferChunk.NextUInt32方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: 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

示例2: 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

示例3: 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

示例4: 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.NextUInt32方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。