Click or drag to resize
Ab4d.SharpEngine logo

RawImageDataCreateOrResize Method

Static method that creates a new RawImageData or resizes the existing one.

Namespace: Ab4d.SharpEngine.Common
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 4.0.9584+ba1aaa26d4181dd3fa8ed7b6398391d1affa36c8
Syntax
C#
public static RawImageData CreateOrResize(
	RawImageData? existingRawImageData,
	int width,
	int height,
	int imageRowStride,
	Format format = Format.B8G8R8A8Unorm,
	bool alwaysRecreateDataArray = false
)

Parameters

existingRawImageData  RawImageData
when set, then the RawImageData is resized if needed; when null a new RawImageData is created
width  Int32
width
height  Int32
height
imageRowStride  Int32
imageRowStride (pixel size in bytes * width)
format  Format  (Optional)
format
alwaysRecreateDataArray  Boolean  (Optional)
when false (by default) then the existing Data array is preserved if its size is bigger or equal to dataLength. When true then new Data array is always created.

Return Value

RawImageData
existingRawImageData or new RawImageData
See Also