Marblecore Imaging Library Documentation

Documentation Introduction
Documentation / Marblecore Imaging / Methods / Create

Create method

Creates a new image with the specified width and height. By default a new 32-bit image will be created which supports alpha transparency. You can disable transparency to create a 24-bit image. When you want to save a 32-bit image to a format which not supports 32-bit images (like JPEG or GIF) the library will automatically convert your image to a 24-bit image. The specified background color will be used for the conversion.

Syntax

Boolean Create(nWidth As Number, nHeight As Number, bTransparency As Boolean, nBackgroundColor As Number, nBackgroundOpacity As Number, nFormat As Format)

Return value

Returns true if the function succeeded.

Parameters

ParameterTypeRequiredDescription
nWidthNumberYesWidth of the new image.
nHeightNumberYesHeight of the new image.
bTransparencyBooleanNoOptional parameter which enables or disables transparency. Transparency is enabled by default.
nBackgroundColorNumberNoOptional background color for the image.
nBackgroundOpacityNumberNoOptional background opacity for the image (only available for transparent images).
nFormatFormat (Enumeration)NoOptional parameter containing the format for the new image.

Example

The example below shows how to use the method. If you take a look at the example code, assume there is a reference to the Marblecore Imaging object with the name 'MarblecoreImaging'. Transparent parts of the image are displayed using a checkerboard pattern.
 
 
1 // Creates a new transparent image
2 MarblecoreImaging.Create(150, 150, true);
3 
4 // Save the new image to the specified file
5 MarblecoreImaging.SaveToFile("example-create.jpg");

Category

Basic operations

See also

Deserialize | LoadFromBase64 | LoadFromFile | LoadFromSerializedStream | LoadFromStream | LoadFromURL | Reset | SaveToBase64 | SaveToFile | SaveToHBitmap | SaveToHBitmapPreMultiplied | SaveToStream | Serialize