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


C# Document.GetCPCPaletteIndices方法代码示例

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


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

示例1: WriteFirmwarePalette

        bool WriteFirmwarePalette(Document.Document tempDocument,
                                    string CPCBitmapFirmwareFilename)
        {
            int[] firmwarePalette = null;

            firmwarePalette = new int[16];
            for (int i = 0; i < 16; i++)
            {
                int palIndex = 0; // black as default color (unused)
                if (i < tempDocument.GetCPCPaletteIndices().Count)
                {
                    palIndex = tempDocument.GetCPCPaletteIndices()[i];
                }

                int firmwareColor = palIndex;

                int finalIndex = i + tempDocument.StartIndex;
                if (finalIndex < 16)
                {
                    firmwarePalette[i + tempDocument.StartIndex] = firmwareColor;
                }
            }

            var bitmapCompiler = BitmapCompiler.CreateCompiler(tempDocument.VideoMode);
            if (!bitmapCompiler.WritePalette(CPCBitmapFirmwareFilename, firmwarePalette, null))
            {
                return false;
            }

            return true;
        }
开发者ID:rgiot,项目名称:phactory,代码行数:31,代码来源:Compiler.cs

示例2: WritePalette

        bool WritePalette(  Document.Document tempDocument, 
                            string CPCBitmapFilename )
        {
            int[] gateArrayPalette = null;

            gateArrayPalette = new int[16];
            for (int i = 0; i < 16; i++)
            {
                int palIndex = 0; // black as default color (unused)
                if (i < tempDocument.GetCPCPaletteIndices().Count)
                {
                    palIndex = tempDocument.GetCPCPaletteIndices()[i];
                }

                int gateArrayColor = tempDocument.GetCPCPaletteGateArray()[palIndex];

                int finalIndex = i + tempDocument.StartIndex;
                if (finalIndex < 16)
                {
                    gateArrayPalette[i + tempDocument.StartIndex] = gateArrayColor;
                }
            }

            var bitmapCompiler = BitmapCompiler.CreateCompiler(tempDocument.VideoMode);
            if (!bitmapCompiler.WritePalette(CPCBitmapFilename, gateArrayPalette, tempDocument.CPCAsicPalette))
            {
                return false;
            }

            return true;
        }
开发者ID:rgiot,项目名称:phactory,代码行数:31,代码来源:Compiler.cs

示例3: WriteFadePalette

        bool WriteFadePalette(Document.Document tempDocument,
                                string outputFadeFilename, 
                                CPCBitmap.Document.Item item, 
                                CPCBitmap.Document.Item targetItem)
        {
            int[] fadeGateArrayPalette = new int[16];
            UInt16[] fadeCPCAsicPalette = new UInt16[16] { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 };

            for (int iClear = 0; iClear < 16; iClear++)
            {
                fadeGateArrayPalette[iClear] = tempDocument.GetCPCPaletteGateArray()[0];
            }

            for (int offset = 0; offset < item.IntermediateImage.Width * item.IntermediateImage.Height; offset++)
            {
                int palIndex = item.IntermediateImage.Data[offset];
                int targetPalIndex = targetItem.IntermediateImage.Data[offset];

                int finalPalIndex = tempDocument.GetCPCPaletteIndices()[palIndex];
                int gateArrayColor = tempDocument.GetCPCPaletteGateArray()[finalPalIndex];

                int finalIndex = targetPalIndex + tempDocument.StartIndex;
                if (finalIndex < 16)
                {
                    fadeGateArrayPalette[targetPalIndex + tempDocument.StartIndex] = gateArrayColor;
                }

                fadeCPCAsicPalette[targetPalIndex + tempDocument.StartIndex] = tempDocument.CPCAsicPalette[palIndex];
            }

            var bitmapCompiler = BitmapCompiler.CreateCompiler(tempDocument.VideoMode);
            if (!bitmapCompiler.WritePalette(outputFadeFilename, fadeGateArrayPalette, fadeCPCAsicPalette))
            {
                return false;
            }

            return true;
        }
开发者ID:rgiot,项目名称:phactory,代码行数:38,代码来源:Compiler.cs


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