Concept of Viewports
Viewports are user-defined screen areas which have their own coordinates, width, height and orientation. Additional to the main viewport 0 (entire main screen), you may define up to 8 viewports (1-8) in total for all screens in a project. They may overlap each other, but consider that they don't have independent memory areas. Therefore, a viewport may overwrite the content of an overlapping other one without saving the underlying area.
All commands (except the Screen Memory Related Commands) executed within a viewport refer to the viewport's size and cursor position. So, for example, Get Display Size returns the height and width of the current viewport, not the entire screen. Text wrapping and scrolling as well as cropping of graphics is also done in the selected viewport's area.
All defined viewports have their own set of attributes (see LCD Attribute Commands). So when switching from viewport 1 to viewport 2 and outputting text in both of them, it shows up on the cursor position and with the colors and attributes of the respective viewport.
Note
Example
\i! { Reset All }
\iCK\D30\D130 { Set Cursor Position to 30/130 }
\iCVD\1\0\D65\D50 { Define Viewport 1 with size of 65x50 }
\iCK\D120\D130 { Set Cursor Position to 120/130 }
\iCVD\2\1\D65\D70 { Define Viewport 2 with size of 65x70 }
\iCK\D280\D130 { Set Cursor Position to 280/130 }
\iCVD\3\3\D78\D72 { Define Viewport 3 with size of 78x72 }
\iCVS\1 { Select Viewport 1 }
\iACB\#FF0000 { Set Background Color to red }
\iDE { Fill viewport with background color }
\iCT\x83\D0\D0 { Center text in viewport }
\iDTViewport 1: Orientation = 0\0 { Draw Text }
\iCVS\2 { Select Viewport 2 }
\iACB\#00FF00 { Set Background Color to green }
\iDE { Fill viewport with background color }
\iCT\x81\D0\D0 { Center horizontally in viewport }
\iDTViewport 2: Orientation = 1\0 { Draw Text }
{ ! Cursor Position now relative to Viewport Origin and Orientation: }
\iCK\D11\D40 { Set Cursor Position to X=11 / Y=40 }
\iG\D14 { Display Local Graphic #14 }
\iCVS\3 { Select Viewport 3 }
\iACB\#0000FF { Set Background Color to blue }
\iACF\#FFFFFF { Set Foreground Color to white }
\iDE { Fill viewport with background color }
\iDTViewport 3:\r { Draw Text }
Orientation = 3\r
Scrolling Text\r
-------------------\r
Viewport 3:\r
Orientation = 3\r
Scrolling Text\0
Not supported by: DPC3020, DPC2060, DPC10xx
Find following commands in this chapter as well as in the category "LCD Control..." when using the parameter completion feature of iLCD Manager XE:
Copyright © demmel products gmbh. All rights reserved.