void Resize( int width, int height, bool clamp )

book_4_sparkGenerated
code_blocksInput

Description

The Resize method of the FloatBitmap class is used to change the dimensions of the bitmap. This method allows you to specify a new width and height for the bitmap, and optionally, whether the resizing should clamp the values to the new dimensions.

Usage

To use the Resize method, you need to have an instance of the FloatBitmap class. Call the method with the desired width and height as integer values, and a boolean value indicating whether to clamp the bitmap to the new size.

For example, if you want to resize a bitmap to 200x100 pixels and ensure that the bitmap is clamped to these dimensions, you would call:

floatBitmap.Resize(200, 100, true);

Example

// Create an instance of FloatBitmap
FloatBitmap floatBitmap = new FloatBitmap();

// Resize the bitmap to 200x100 pixels, with clamping
floatBitmap.Resize(200, 100, true);

// Access the new dimensions
int newWidth = floatBitmap.Width;
int newHeight = floatBitmap.Height;

// Output the new dimensions
// Note: Avoid using Console.WriteLine in Sandbox
// Use appropriate logging or debugging methods instead
// Debug.Log($"New dimensions: {newWidth}x{newHeight}");