// Generalized bit block transfer // Can transfer from any device context to this one. 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 += GDI32.EMR_BITBLT; Pack(chunk, x, y); Pack(chunk, pixBuff.Pixels.Width, pixBuff.Pixels.Height); chunk += dataSize; // Finally, copy in the data chunk.CopyFrom(pixBuff.Pixels.Data, dataSize); PackCommand(chunk); }
// 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); }
internal void AppendPayload(IntPtr ptr, int length) { buffer.CopyFrom(ptr, length); }