Byte[] vals = {0x00, //0000 0000 0x01, //0000 0001 0x03, //0000 0011 0x07, //0000 0111 0x0F, //0000 1111 0x1F, //0001 1111 0x3F }; //0011 1111 Int16 n = 0;
L0.Image = ((vals[n] & 1) == 1) ? LON.Image : LOFF.Image; L1.Image = ((vals[n] & 2) == 2) ? LON.Image : LOFF.Image; L2.Image = ((vals[n] & 4) == 4) ? LON.Image : LOFF.Image; L3.Image = ((vals[n] & 8) == 8) ? LON.Image : LOFF.Image; L4.Image = ((vals[n] & 16) == 16) ? LON.Image : LOFF.Image; //-----------------next index pointer---------------------- if (n < vals.Length - 1) n++; else n = 0;
L0.Image = ((vals[n] & 1) == 1) ? LON.Image : LOFF.Image;
if((vals[n] & 1) == 1){ L0.Image=LON.Image;}else{ L0.Image=LOFF.Image;}