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


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


new bitmap(unknownImage)


any classunknownImageAn instance of an unknown class.

Return value

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.


clipboard cp;


cbimage cbim = cp.GetImage();


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.


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


Copyright © Rice All rights reserved.