## LiveCode Lessons

5 stars based on 77 reviews

The Livecode binaryencode on this page is based on the MetaCard 2. Fixed examples to make sure byte order is correct. The image livecode binaryencode composed of a sequence of bit binary values key in on the word binaryso each pixel in an contains 32 bits; eight for redeight for greeneight for blue and eight for something else an alpha value, I think. An example of the binary value for is There are eight bits in a byte, so each pixel is composed of four bytes.

Based on the livecode binaryencode, our 20 x 40 image has these stats: Each pixel is represented by four bytes in the order of OtherRedGreenBlue. The Other byte is always 0. Using the basic information above, a three pixel 1 row by 3 pixels image where the first pixel is pure Red, the second pure Green and the third pure Blue would have the following: The bit binary values are retrieved from an image by livecode binaryencode for the imageData of an image and can be stored in a variable or custom property for later use.

Why does this work? Well, if you notice that the byte livecode binaryencode in the table above are able to contain a value from 0 toand you consider livecode binaryencode the ASCII value of a character is also from 0 toit makes sense to be able to retrieve the numeric value of a byte by thinking of the bytes of an image as charactersand then using charToNum to get the value.

Note also that if you This is a property of an image where it is an all-or-nothing mask of a given pixel of an image. Note that this is dealing with pixelsnot bits. The maskData contains 8-bit 1 byte or character binary values that livecode binaryencode a value that is either zero or non-zero. If the value is 0that pixel is transparent. Livecode binaryencode the value is non-zerothe pixel is opaque. So in our 3-pixel image example, if you executed Since it isthe pixel is opaque.

This is a property of an image where you can impose a variable level of transparency for a given pixel livecode binaryencode an image. Note that like maskDatathis is dealing with pixelsnot bits. The alphaData contains 8-bit 1 byte or character livecode binaryencode values that have a value from 0 to If the value is 0the pixel is transparent. If the value isthe value is fully opaque.

Any other value inbetween sets a level of livecode binaryencode i. You probably noticed that it is similar to the maskData property, and livecode binaryencode effectively do everything maskData can do and more. So why not just use alphaData all the time? Livecode binaryencode need to set the imageData of the image after you have applied a mask or an alpha change.