Method SetSimpleDialogClearDisplay
SetSimpleDialogClearDisplay(SelectBufClearOption)
Clears one of each display buffer or both display buffers in the simple dialog mode.
Declaration
Error SetSimpleDialogClearDisplay(SelectBufClearOption buffersToClear)
Parameters
Type | Name | Description |
---|---|---|
SelectBufClearOption | buffersToClear |
Returns
Type | Description |
---|---|
Error | Error codes |
Remarks
Rendering a cleared buffer will depict a black screen.
Examples
The following example writes a numbered image to the visible buffer and clears it 100 times.
C#
Error error = driver.SetSimpleDialogMode();
for (int k = 0; k < 100; k++)
{
int height = 80;
Bitmap bitmap = GetNumberedTile(k, height, height, new Pen(Brushes.Blue, 4f));
error = driver.SetSimpleDialogResourceImage(bitmap, 0, 0, SelectBuf.CurrentBuffer);
error = driver.SetSimpleDialogClearDisplay(SelectBufClearOption.CurrentBuffer);
}
Bitmap GetNumberedTile(int number, int width, int height, Pen boxPen)
{
float emSize = 16.0f;
Rectangle box = new Rectangle(0, 0, width, height);
Bitmap bitmap = new Bitmap(box.Width, box.Height);
using Graphics g = Graphics.FromImage(bitmap);
g.Clear(Color.Transparent);
g.DrawString($"{number}.", new Font(FontFamily.GenericSansSerif, emSize, FontStyle.Regular),
Brushes.White, new PointF(width / 2 - emSize, height / 2 - emSize));
g.DrawRectangle(boxPen, box);
return bitmap;
}