Project

General

Profile

Up

_SETbitmap8

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

Prototype :

fun [ObjBitmap8 S] ObjBitmap8

  • ObjBitmap8 : a 8-bits bitmap object

  • I : x coordonate of the pixel

  • I : y coordonate of the pixel

Return : I the same bitmap or nil if error

See also :

_GETbitmap8

Example :

typeof Bmp8 = ObjBitmap8;;

// fun [S I I] I
fun __receiveBitmap8datas (strDatas, iWidth, iHeight)=
	// If the bitmap already exists, it is destroyed
	if Bmp8 != nil then
	(
		_DSbitmap8 Bmp8;
		Bmp8 = nil
	)
	else
		nil;
	// Create a new bitmap
	set Bmp8 = _CRbitmap8 _channel iWidth iHeight;
	if Bmp8 == nil then	// Creation failed
	(
		_fooS ">> receiveBitmap8datas : Unable to create the 8-bits bitmap !";
		1
	)
	else	// The content is set
	(
		set Bmp8 = _SETbitmap8 Bmp8 strDatas;
		0
	);;