Table of Contents [Hide/Show]
stColor type Fields GUI type editor Code examples clTime type clPoint type Fields GUI type editor clSize type Fields GUI type editor clMIDINote type Fields clMIDIEvent type Fields Enum Types stAlignment Final Notes
Screenshot of the stColor GUI editor
// Implicit conversions for stColor type MyColor=Color.Red; MyColor="Blue"; MyColor="#FF00FF00"; // Declaration and initialization // declare a new stColor and initialize its value to the green stColor MyColor=new stColor(); MyColor.A=255; MyColor.R=0; MyColor.G=255; MyColor.B=0; // declare and initialize with the green color with an optional stColor constructors stColor MyColor2=new stColor(0,255,0); stColor MyColor3=new stColor(255,0,255,0); // declare and initialize the blue color with functions and constants of GDI+ API stColor MyColor3.GDIColor=Color.FromArgb(255,0,0,255); stColor MyColor4.GDIColor=Color.Blue;
// using stColor type in GDI+ drawing procedures stColor RedColor=new stColor(127,0,0); Pen BluePen = new Pen(RedColor.GDIColor, 3); Graphics.DrawRectangle(BluePen, 0,0,50,50);
// Internal fields the stColor type BackgroundColor=new stColor(255,255,255); // set the event background to white TextColor.R=127; TextColor.G=127; TextColor.B=127; // set the font color of the Text Element to the mid-gray
// The following examples cause runtime errors because the field values have to be integers in the range 0..255 stColor MyColor=new stColor(0,256,0); stColor MyColor2; MyColor2.R=-20;
// Assigning clTime type with implicit conversions int TimeA=2000; double TimeB=1000.5; EventA_Duration=TimeA; // the time interval is assigned with integer value EventB_Duration=TimeB; // the time interval is assigned with double precision EventC_Duration=500.5; // the time interval is assigned directly int TimeC=EventC_Duration; // TimeC contains 501 due to rounding
Screenshot of the clPoint GUI editor
// declare and initialize clPoint type clPoint MyPoint=new clPoint(); // the point is declared and initialized. The point is valid. clPoint MyPoint2=new clPoint(100,100); // the point is declared and initialized with particular pixel coordinates clPoint MyPoint3=new clPoint(4.0f,45.0f); // the point is declared and initialized with the polar coordinates 4,45
// Pixel fields of clPoint type Position=new clPoint(512,368); // Initialize with pixels coordinates Position.X=512; Position.Y=368; // set the position to the screen center
// Polar fields of of clPoint type Position=new clPoint(5.0f,90.0f); // Initialize with polar coordinates // set the position of Text Element on 5 visual degree up from the screen center (in any screen resolution) TextPosition.R=5; TextPosition.Theta=90;
Screenshot of the clSize GUI editor
// declare and initialize clPoint type clSize MySize=new clSize(); // the size is declared and initialized with zero values. clSize MySize2=new clSize(320,200); // the size is declared and initialized with specific pixel size clSize MySize3=new clSize(5.0f,2.0f); // the size is declared and initialized with specific size in visual degrees
// Change values of proxy variables (Size and TextAreaSize) of clSize type Size=new clSize(200,80); // set the size of Renderer element to 200x80 pixels TextAreaSize.aWidth=5.5f; TextAreaSize.aHeight=2.1f; // set the size of Text Element on 5.5x2.1 visual degrees
// Change values of proxy variables (RendererAlignment) of stAlignment type RendererAlignment=0; /// change the position alignment to the left-top corner