本文整理汇总了C#中NewTOAPIA.BufferChunk.CopyFrom方法的典型用法代码示例。如果您正苦于以下问题:C# BufferChunk.CopyFrom方法的具体用法?C# BufferChunk.CopyFrom怎么用?C# BufferChunk.CopyFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NewTOAPIA.BufferChunk
的用法示例。
在下文中一共展示了BufferChunk.CopyFrom方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BitBlt
public override void BitBlt(int x, int y, PixelBuffer pixBuff)
{
// Create a buffer
// It has to be big enough for the bitmap data, as well as the x,y, and command
int dataSize = pixBuff.Pixels.Stride * pixBuff.Pixels.Height;
BufferChunk chunk = new BufferChunk(dataSize + 128);
// now put the basic command and simple components in
chunk += SpaceControlChannel.SC_BitBlt;
CodecUtils.Pack(chunk, x, y);
CodecUtils.Pack(chunk, pixBuff.Pixels.Width, pixBuff.Pixels.Height);
chunk += dataSize;
// Finally, copy in the data
chunk.CopyFrom(pixBuff.Pixels.Data, dataSize);
PackCommand(chunk);
}
示例2: CopyPixels
public virtual void CopyPixels(int x, int y, int width, int height, PixelBuffer24 pixBuff)
{
// Create a buffer
// It has to be big enough for the bitmap data, as well as the x,y, and command
int dataSize = (width) * (height) * pixBuff.Pixels.BytesPerPixel;
BufferChunk chunk = new BufferChunk(dataSize + 128);
// now put the basic command and simple components in
chunk += SpaceControlChannel.SC_CopyPixels;
CodecUtils.Pack(chunk, x, y, width, height);
chunk += dataSize;
// Finally, copy in the data
int numBytesPerRow = pixBuff.Pixels.BytesPerPixel * width;
IntPtr rowPtr = pixBuff.Pixels.Data;
int offset = 0;
int row = 0;
for (row = y; row < (y + height); row++)
{
offset = pixBuff.Pixels.Data.ToInt32() + row * pixBuff.Pixels.Stride + x * pixBuff.Pixels.BytesPerPixel;
rowPtr = (IntPtr)offset;
chunk.CopyFrom(rowPtr, numBytesPerRow);
}
PackCommand(chunk);
}
示例3: AlphaBlend
//public override void BitBlt(int x, int y, PixelBuffer pixBuff)
//{
// // Create a buffer
// // It has to be big enough for the bitmap data, as well as the x,y, and command
// int dataSize = pixBuff.Pixels.Stride * pixBuff.Pixels.Height;
// BufferChunk chunk = new BufferChunk(dataSize + 128);
// // now put the basic command and simple components in
// chunk += SpaceControlChannel.SC_BitBlt;
// CodecUtils.Pack(chunk, x, y);
// CodecUtils.Pack(chunk, pixBuff.Pixels.Width, pixBuff.Pixels.Height);
// chunk += dataSize;
// // Finally, copy in the data
// chunk.CopyFrom(pixBuff.Pixels.Data, dataSize);
// PackCommand(chunk);
//}
public virtual void AlphaBlend(int x, int y, int width, int height,
PixelBuffer24 pixBuff, int srcX, int srcY, int srcWidth, int srcHeight,
byte alpha)
{
// Create a buffer
// It has to be big enough for the bitmap data, as well as the x,y, and command
int dataSize = pixBuff.Pixels.BytesPerPixel * srcWidth * srcHeight;
BufferChunk chunk = new BufferChunk(dataSize + 128);
// now put the basic command and simple components in
chunk += SpaceControlChannel.SC_AlphaBlend;
CodecUtils.Pack(chunk, x, y, width, height);
CodecUtils.Pack(chunk, srcX, srcY, srcWidth, srcHeight);
chunk += alpha;
CodecUtils.Pack(chunk, srcWidth, srcHeight);
chunk += dataSize;
// Finally, copy in the data
// One row at a time
int numBytesPerRow = pixBuff.Pixels.BytesPerPixel * srcWidth;
IntPtr rowPtr = pixBuff.Pixels.Data;
int offset = rowPtr.ToInt32() + srcY * pixBuff.Pixels.Stride + srcX * pixBuff.Pixels.BytesPerPixel;
for (int row = srcY; row < (srcY + srcHeight); row++)
{
rowPtr = (IntPtr)offset;
chunk.CopyFrom(rowPtr, numBytesPerRow);
offset = rowPtr.ToInt32() + row * pixBuff.Pixels.Stride + srcX * pixBuff.Pixels.BytesPerPixel;
}
PackCommand(chunk);
}
示例4: PixBlt
// Generalized bit block transfer
public override void PixBlt(PixelArray pixBuff, int x, int y)
{
// Create a buffer
// It has to be big enough for the bitmap data, as well as the x,y, and command
int dataSize = pixBuff.BytesPerRow * pixBuff.Height;
BufferChunk chunk = new BufferChunk(dataSize + 128);
// now put the basic command and simple components in
chunk += GDI32.EMR_BITBLT;
ChunkUtils.Pack(chunk, x, y);
ChunkUtils.Pack(chunk, pixBuff.Width, pixBuff.Height);
chunk += dataSize;
// Finally, copy in the data
chunk.CopyFrom(pixBuff.PixelData, dataSize);
SendCommand(chunk);
}
示例5: AlphaBlend
public override void AlphaBlend(int x, int y, int width, int height,
PixelBuffer pixBuff, int srcX, int srcY, int srcWidth, int srcHeight,
byte alpha)
{
// Create a buffer
// It has to be big enough for the bitmap data, as well as the x,y, and command
int dataSize = pixBuff.Pixels.Stride * pixBuff.Pixels.Height;
BufferChunk chunk = new BufferChunk(dataSize + 128);
// now put the basic command and simple components in
chunk += GDI32.EMR_ALPHABLEND;
Pack(chunk, x, y, width, height);
Pack(chunk, srcX, srcY, srcWidth, srcHeight);
chunk += alpha;
Pack(chunk, pixBuff.Pixels.Width, pixBuff.Pixels.Height);
chunk += dataSize;
// Finally, copy in the data
chunk.CopyFrom(pixBuff.Pixels.Data, dataSize);
PackCommand(chunk);
}