jeudi 28 juillet 2016

Get a number with the same ratio

hi,

let say you would like to fill an ellipse with a color. the color should be related to the x position of the mouse.

like if x is 0 the color should be black...
but what would happen if your canvas size is bigger then 255 ?? you will probably get an error.

so what you need to do is get a number with the same ratio as the coordinate u want to use but that will fit your needs.

EXAMPLE:

Canvas = 0 to 640 (width/x axis)
Color = 0 to 255

now according to my x position in that canvas i...

Get a number with the same ratio

from B4X Community - Android, iOS, desktop, server and IoT programming tools http://ift.tt/2aNqLCN
via IFTTT

Aucun commentaire:

Enregistrer un commentaire