Image Class Reference

Image. More...

List of all members.

Public Member Functions

 Image (string filename)
 Image constructor (from filename)
 Image (byte[] fileImage)
 Image constructor (from the file image)
 Image (ImageMode mode, ImageSize size, ImageColor color)
 Image constructor (from the image mode, size, and color)
 Image (ImageMode mode, ImageSize size, byte[] buffer)
 Image constructor (from the image mode, size, and buffer)
virtual Object ShallowClone ()
 Copies Image object.
void Dispose ()
 Frees unmanaged resources of Image.
void Decode ()
 Decodes image.
byte[] ToBuffer ()
 Obtains the memory image of the image.
void ReadBuffer (byte[] buffer)
 Reads the memory image of the image in the provided buffer.
Image Resize (ImageSize size)
 Creates a new image object after scaling.
Image Crop (ImageRect rect)
 Creates a new Image object by cutting out a part of an already-existing image.
void DrawImage (Image source, ImagePosition position)
 Pastes a different image within the image.
void DrawRectangle (ImageColor color, ImageRect rect)
 Renders a single-colored rectangle within the image.
void DrawText (string text, ImageColor color, Font font, ImagePosition position)
 Renders text within the image (all of the character string)
void DrawText (string text, int offset, int len, ImageColor color, Font font, ImagePosition position)
 Renders text within the image (part of the character string)
void Export (string albumname, string filename)
 Saves the image with the specified filename.
void SaveAs (string path)
 Saves the image in the specified file path.

Protected Member Functions

 Image (Image image)
 Image constructor (copied from another Image object)

Properties

ImageSize Size [get]
 Image size.
ImageSize DecodeSize [set]
 Image size upon decoding.

Detailed Description


Constructor & Destructor Documentation

Image ( string  filename)

Image constructor (from filename)

Parameters:
filenameImage filename

The image is not actually decoded immediately after Image is created from an image file. To decode the image, Decode() must be called. However, even if the image has not been decoded, it is still possible to obtain Size, for example. The currently supported image file formats are PNG, BMP, JPG, and GIF.

Image ( byte[]  fileImage)

Image constructor (from the file image)

Parameters:
fileImageImage file image

The image is not actually decoded immediately after Image is created from an image file. To decode the image, Decode() must be called. However, even if the image has not been decoded, it is still possible to obtain Size, for example. The currently supported image file formats are PNG, BMP, JPG, and GIF.

Image ( ImageMode  mode,
ImageSize  size,
ImageColor  color 
)

Image constructor (from the image mode, size, and color)

Parameters:
modeImage mode
sizeImage size
colorColor

The width and height given to the argument size must each be between 0 and 4096.

Image ( ImageMode  mode,
ImageSize  size,
byte[]  buffer 
)

Image constructor (from the image mode, size, and buffer)

Parameters:
modeImage mode
sizeImage size
bufferColor

The width and height given to the argument size must each be between 0 and 4096.

Image ( Image  image) [protected]

Image constructor (copied from another Image object)

Parameters:
imageCopy source Image object

A separate Image object is copied to create a new Image object. However, the actual body of the Image is not copied and one unmanaged resource will be shared. To free an unmanaged resource of an Image, Dispose() must be called for all the copied Image objects.


Member Function Documentation

Image Crop ( ImageRect  rect)

Creates a new Image object by cutting out a part of an already-existing image.

Parameters:
rectRectangular area to be cut
Returns:
Cut image
void DrawImage ( Image  source,
ImagePosition  position 
)

Pastes a different image within the image.

Parameters:
sourceImage to be pasted
positionCoordinate of the paste position (upper left)
void DrawRectangle ( ImageColor  color,
ImageRect  rect 
)

Renders a single-colored rectangle within the image.

Parameters:
colorRectangle color
rectRectangle
void DrawText ( string  text,
ImageColor  color,
Font  font,
ImagePosition  position 
)

Renders text within the image (all of the character string)

Parameters:
textCharacter string
colorFont color
fontFont
positionCoordinate within the image (upper left of the text)

DrawText is the action of rendering text on a transparent image. The RGB value is overwritten with the color provided by the color argument, and the Alpha value is blended. When DrawText is called for an opaque image, the expected effect cannot be obtained.

void DrawText ( string  text,
int  offset,
int  len,
ImageColor  color,
Font  font,
ImagePosition  position 
)

Renders text within the image (part of the character string)

Parameters:
textCharacter string
offsetOffset of the position to be used to render in the string
lenLength to use for the render in the string
colorFont color
fontFont
positionCoordinate within the image (upper left of the text)

DrawText is the action of rendering text on a transparent image. The RGB value is overwritten with the color provided by the color argument, and the Alpha value is blended. When DrawText is called for an opaque image, the expected effect cannot be obtained.

void Export ( string  albumname,
string  filename 
)

Saves the image with the specified filename.

Parameters:
albumnameOutput album name
filenameOutput filename

Arguments cannot use characters other than A-Za-z0-9!#$%&'()+,-.;=@[]^_`{}. In addition, 64 or more characters cannot be used. The currently valid image file formats for save targets are PNG, JPG, and BMP. To the argument "filename", filename including the extension of the image format that you want to save needs to be specified. When executing with Windows Simulator, it is saved in the "My Pictures" folder.

void ReadBuffer ( byte[]  buffer)

Reads the memory image of the image in the provided buffer.

Parameters:
bufferBuffer of read destination
Image Resize ( ImageSize  size)

Creates a new image object after scaling.

Parameters:
sizeSize of the image after scaling
Returns:
Scaled image
void SaveAs ( string  path)

Saves the image in the specified file path.

Parameters:
pathOutput file path

Arguments cannot use characters other than / and A-Za-z0-9!#$%&'()+,-.;=@[]^_`{}. The currently valid image file formats for save targets are PNG, JPG, and BMP. To the argument "path", filename including the extension of the image format that you want to save needs to be specified.

virtual Object ShallowClone ( ) [virtual]

Copies Image object.

A separate Image object is copied to create a new Image object. However, the actual body of the Image is not copied and one unmanaged resource will be shared. To free an unmanaged resource of an Image, Dispose() must be called for all the copied Image objects.

byte [] ToBuffer ( )

Obtains the memory image of the image.

Returns:
Memory image of the image

Property Documentation

ImageSize DecodeSize [set]

Image size upon decoding.

By setting DecodeSize before calling Decode(), decoding can be performed while enlarging/reducing the image.