Project

General

Profile

Previous Up Next

_SETbitmap
Set the binary content of a bitmap. Typically, this is used when a computer A wants to send a picture to computer B : computer A gets the binary content by _GETbitmap, sends the string to computer B which calls this function.

ObjBitmap _SETbitmap (
ObjBitmap _bitmap_
S _content_
)
Parameters

_bitmap_
any bitmap
_content_
new binary content
Return value

same bitmap

See also :

_GETbitmap

Example :

typeof Bmp = ObjBitmap;;

// fun [S I I] I
fun __receiveBitmapDatas (strDatas, iWidth, iHeight)=
	// If the bitmap already exists, it is destroyed
	if Bmp != nil then
	(
		_DSbitmap Bmp;
		Bmp = nil
	)
	else
		nil;
	// Create a new bitmap
	set Bmp = _CRbitmap _channel iWidth iHeight;
	if Bmp == nil then	// Creation failed
	(
		_fooS ">> receiveBitmapDatas : Unable to create the bitmap !";
		1
	)
	else	// The content is set
	(
		set Bmp = _SETbitmap Bmp strDatas;
		0
	);;