Home Notices Documents Classes Download Others Rice
Classes  >  bitmap  >  bitmap(anyclass)
bitmap class : bitmap(anyclass) fitter

Description

Gets a new instance of the bitmap class from an unknown class.

Syntax

new bitmap(unknownImage)

Arguments

ClassNameDescription
any classunknownImageAn instance of an unknown class.

Return value

ClassDescription
bitmapA new instance of bitmap class which was initialized.

Sample code

Following is a sample code using the clipboard and cbimage classes included in Rtype.ClipboardGX.dll.

This code assumes that Rtype.ClipboardGX.dll is embedded in CookerGX and there is an image on the clipboard.

Since Rtype.ClipboardGX.dll is not always embedded in CookerGX, bitmap and cbimage can not assume each other's existence.

That is, cbimage is an unknown class for bitmap.

1:

clipboard cp;

2:

cbimage cbim = cp.GetImage();

3:

bitmap bmp = new bitmap(cbim);

This code works fine.

That is, it is possible to convert arguments of unknown class into bitmap by using this fitter.

Notes

An unknown class which is an argument must be implemented internally so that implicit type conversion to System.Drawing.Bitmap is possible.

Please refer to the documentation of each class whether the class can be implicitly converted to System.Drawing.Bitmap.

An instance returned with this fitter has already been initialized.

Links for reference

None.

Copyright © Rice All rights reserved.