Esempio n. 1
0
        public void DrawBitmap(BitStreamer bs, Point p, uint xsize, uint ysize, bool color)
        {
            for (int yPos = p.Y; yPos != p.Y + ysize; yPos++)
            {
                int  BufPos    = bytesPrLine * yPos + p.X / 8;
                uint xBitsLeft = xsize;
                int  xPos      = p.X;

                while (xBitsLeft > 0)
                {
                    int  bitPos      = xPos & 0x7;
                    uint bitsToWrite = Math.Min(xBitsLeft, (uint)(8 - bitPos));
                    if (color)
                    {
                        displayBuf[BufPos] |= (byte)(bs.GetBits(bitsToWrite) << bitPos);
                    }
                    else
                    {
                        displayBuf[BufPos] &= (byte)~(bs.GetBits(bitsToWrite) << bitPos);
                    }
                    xBitsLeft -= bitsToWrite;
                    xPos      += (int)bitsToWrite;
                    BufPos++;
                }
            }
        }
Esempio n. 2
0
		public override void DrawBitmap (BitStreamer bs, MonoBrickFirmware.Display.Point p, uint xSize, uint ySize, bool color)
		{
			base.DrawBitmap (bs, p, xSize, ySize, color);
			for (int x = 0; x < xSize; x++) 
			{
				for (int y = 0; y < ySize; y++)
				{
					bool isSet = base.IsPixelSet (x + p.X, y + p.Y);
					if (isSet)
					{
						display.SetPixel (x + p.X, y + p.Y);
					} 
					else 
					{
						display.ClearPixel(x + p.X, y + p.Y);		
					}
				}
			}
		}
Esempio n. 3
0
 public static void DrawBitmap(BitStreamer bs, Point p, uint xsize, uint ysize, bool color)
 {
   Instance.DrawBitmap(bs,p,xsize,ysize,color);
 }
Esempio n. 4
0
        public void DrawBitmap(BitStreamer bs, Point p, uint xsize, uint ysize, bool color)
        {
            for (int yPos = p.Y; yPos != p.Y+ysize; yPos++)
            {
                int BufPos = bytesPrLine*yPos+p.X/8;
                uint xBitsLeft = xsize;
                int xPos = p.X;

                while (xBitsLeft > 0)
                {
                    int bitPos = xPos & 0x7;
                    uint bitsToWrite = Math.Min(xBitsLeft, (uint)(8-bitPos));
                    if (color)
                        displayBuf[BufPos] |= (byte)(bs.GetBits(bitsToWrite) << bitPos);
                    else
                        displayBuf[BufPos] &= (byte)~(bs.GetBits(bitsToWrite) << bitPos);
                    xBitsLeft -= bitsToWrite;
                    xPos += (int)bitsToWrite;
                    BufPos++;
                }
            }
        }
Esempio n. 5
0
 public static void DrawBitmap(BitStreamer bs, Point p, uint xsize, uint ysize, bool color)
 {
     Instance.DrawBitmap(bs, p, xsize, ysize, color);
 }