SetThickness

Bitmaps
Aptilis 1

SetThickness(BitmapHandle, Thickness)

SetThickness allows you to specify how thick points should be when drawing pixels, lines, ellipses, boxes, and text.
The only acceptable values are: 1, 3 and 5. They set drawn points diameters to respectively 1, 3 and 5 pixels. Text written in thickness 5 is hardly legible, where 3 gives text a 'bold' aspect.
True Type Fonts selected through setFont are not affected by setThickness, only the bitmaped, default font is.

Return Value:
0 if everything was OK or -1 if you indicated a non-valid bitmap or an incorrect thickness.

Example:

b = createBitmap(220, 110)
if b = -1
print("Oops, it was impossible to create a bitmap...\n")
else

white = RGB(255, 255, 255)
clearBitmap(b, white)

// Thickness valid values are 1, 3, 5
for i=1 to 5 step 2

thickDemo(b, i)

end for

saveGIFFile("thick.gif", b)

deleteBitmap(b)
end if


sub thickDemo(bitmap, thickness)

y = thickness * 15

setThickness(bitmap, thickness)
printAt(bitmap, 10, y + 10, "Aptilis", RGB(0, 255, 0))
line(bitmap, 70, y-10, 100, y + 10, RGB(255, 255, 0))
ellipse(bitmap, 140, y, 12, 12, RGB(0, 0, 190))
box(bitmap, 160, y-12, 200, y + 12, RGB(255, 190, 0), 0)


end thickDemo
Result:

For more details see the Bitmap topic.