本文整理汇总了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;
}
示例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;
}
示例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;
}