Show / Hide Table of Contents

Class BitmapConverter

Converts pixel data from network wire format to a proper bitmap format.

Inheritance
object
BitmapConverter
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Microsoft.XboxStudios.UnrealToolkit.Bifrost.HookClient
Assembly: UnrealToolkit.Bifrost.HookClient.dll
Syntax
public static class BitmapConverter

Methods

View Source

PadLines(byte[], int, int, out int)

Pads the image as required by the bitmap format for each row to consist of a multiple of 4 bytes.

Declaration
public static byte[] PadLines(byte[] image, int width, int height, out int stride)
Parameters
Type Name Description
byte[] image

The unpadded image data.

int width

The image width.

int height

The image height.

int stride

Stores the padded image width, including any hidden pixel data.

Returns
Type Description
byte[]

The padded image data.

Remarks

This can be used to load a System.Drawing.Bitmap like so: var image = await client.TakeAndGetScreenshotAsync(); var data = BitmapConverter.PadLines(image.Image, image.Width, image.Height, out int stride); var pointer = Marshal.UnsafeAddrOfPinnedArrayElement(data, 0); var bmp = new Bitmap(image.Width, image.Height, stride, PixelFormat.Format24bppRgb, pointer);

  • View Source
In this article
Back to top Generated by DocFX