Set draw window

Description

The draw window is a partial rectangle area on the full screen, all following drawing on screen will be remapped to this window, untill use "unset draw window" command.

The default draw window is the full screen when power on or run "unset draw window" command.

Usage:

Direct:

 "DWWINxywh"

Arduino:

void setDrawWindow(unsigned int x, unsigned int y, unsigned int width, unsigned int height)

C:

void Digole_setDrawWindow(unsigned int x, unsigned int y, unsigned int width, unsigned int height)

Parameters:

x,y

The top-left pixel position on the screen of draw window.

w(width),h(height)

The pixel's width and height of the draw window

Return:

none

Example (Arduino):

mydisp.drawStr(1,1,"Hello World!"); //display "Hello World!" at position(1,1) in the full screen

mydisp.setDrawWindow(50,50,100,200); //set a draw window the top-left position at (50,50), width is 100px,height is 200px
mydisp.drawStr(1,1,"Hello World!"); //display "Hello World!" at position (1,1) in the draw window

Example(direct)

serial.writeString("DWWIN\x32\x32\x64\xC8"); //set a draw window the top-left position at (50,50), width is 100px,height 

Note: if any number of (x,y,width,height) over 254, then must use 2 bytes format

Changelog

Version Description
   

See Also

unset draw window 

Clear draw window