示例#1
0
 /// <summary>
 /// Creates a new <see cref="LcdPage"/> on the given device.
 /// </summary>
 /// <param name="device">Device where this page will be shown.</param>
 protected LcdPage(LcdDevice device)
 {
     _device          = device ?? throw new ArgumentNullException("device");
     DesiredFramerate = 30;
     LastFrameUpdate  = TimeSpan.Zero;
     Priority         = LcdPriority.Normal;
     UpdateMode       = LcdUpdateMode.Async;
 }
示例#2
0
 /// <summary>
 /// Creates a new <see cref="LcdGdiPage"/> on the given device.
 /// </summary>
 /// <param name="device">Device where this page will be shown.</param>
 public LcdGdiPage(LcdDevice device)
     : base(device)
 {
     if (device.BitsPerPixel != 8 && device.BitsPerPixel != 32)
     {
         throw new NotSupportedException("Only 8bpp and 32bpp devices are supported.");
     }
     _bitmap      = new Bitmap(device.PixelWidth, device.PixelHeight, PixelFormat.Format32bppArgb);
     _rectangle   = new Rectangle(0, 0, device.PixelWidth, device.PixelHeight);
     _32BppPixels = new byte[device.PixelWidth * device.PixelHeight * 4];
     if (device.BitsPerPixel == 8)
     {
         _8BppPixels = new byte[device.PixelWidth * device.PixelHeight];
     }
 }