Type | Description | |||
LColor | A LColor object that holds the solid / EBN color to be applied on the layer's background. |
The following properties can be used to move / resize the layer:
You can use the following properties to offset the view ( background + foreground ) inside the layer:
The following screen shot shows a layer with solid red color:
And if we decompose the layers we get:
The following samples show how you can apply a solid color to be display on left-half of the layer after the first visible layer:
VBA (MS Access, Excell...)
With Gauge1 .BeginUpdate .PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 1" .PicturesName = "`Layer` + int(value + 1) + `.png`" .Layers.Count = 5 With .Layers.Add("Solid") .Position = 1 .Width = "width/2" .Background.Color.Value = RGB(255,0,0) End With .EndUpdate End With
VB6
With Gauge1 .BeginUpdate .PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 1" .PicturesName = "`Layer` + int(value + 1) + `.png`" .Layers.Count = 5 With .Layers.Add("Solid") .Position = 1 .Width = "width/2" .Background.Color.Value = RGB(255,0,0) End With .EndUpdate End With
VB.NET
With Exgauge1 .BeginUpdate() .PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 1" .PicturesName = "`Layer` + int(value + 1) + `.png`" .Layers.Count = 5 With .Layers.Add("Solid") .Position = 1 .Width = "width/2" .Background.Color.Value = Color.FromArgb(255,0,0) End With .EndUpdate() End With
VB.NET for /COM
With AxGauge1 .BeginUpdate() .PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 1" .PicturesName = "`Layer` + int(value + 1) + `.png`" .Layers.Count = 5 With .Layers.Add("Solid") .Position = 1 .Width = "width/2" .Background.Color.Value = RGB(255,0,0) End With .EndUpdate() End With
C++
/* Copy and paste the following directives to your header file as it defines the namespace 'EXGAUGELib' for the library: 'ExGauge 1.0 Control Library' #import <ExGauge.dll> using namespace EXGAUGELib; */ EXGAUGELib::IGaugePtr spGauge1 = GetDlgItem(IDC_GAUGE1)->GetControlUnknown(); spGauge1->BeginUpdate(); spGauge1->PutPicturesPath(L"C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Knob 1"); spGauge1->PutPicturesName(L"`Layer` + int(value + 1) + `.png`"); spGauge1->GetLayers()->PutCount(5); EXGAUGELib::ILayerPtr var_Layer = spGauge1->GetLayers()->Add("Solid"); var_Layer->PutPosition(1); var_Layer->PutWidth(L"width/2"); var_Layer->GetBackground()->GetColor()->PutValue(RGB(255,0,0)); spGauge1->EndUpdate();
C++ Builder
Gauge1->BeginUpdate(); Gauge1->PicturesPath = L"C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Knob 1"; Gauge1->PicturesName = L"`Layer` + int(value + 1) + `.png`"; Gauge1->Layers->Count = 5; Exgaugelib_tlb::ILayerPtr var_Layer = Gauge1->Layers->Add(TVariant("Solid")); var_Layer->Position = 1; var_Layer->Width = L"width/2"; var_Layer->Background->Color->Value = RGB(255,0,0); Gauge1->EndUpdate();
C#
exgauge1.BeginUpdate(); exgauge1.PicturesPath = "C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Knob 1"; exgauge1.PicturesName = "`Layer` + int(value + 1) + `.png`"; exgauge1.Layers.Count = 5; exontrol.EXGAUGELib.Layer var_Layer = exgauge1.Layers.Add("Solid"); var_Layer.Position = 1; var_Layer.Width = "width/2"; var_Layer.Background.Color.Value = Color.FromArgb(255,0,0); exgauge1.EndUpdate();
JScript/JavaScript
<BODY onload="Init()"> <OBJECT CLASSID="clsid:91628F12-393C-44EF-A558-83ED1790AAD3" id="Gauge1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { Gauge1.BeginUpdate(); Gauge1.PicturesPath = "C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Knob 1"; Gauge1.PicturesName = "`Layer` + int(value + 1) + `.png`"; Gauge1.Layers.Count = 5; var var_Layer = Gauge1.Layers.Add("Solid"); var_Layer.Position = 1; var_Layer.Width = "width/2"; var_Layer.Background.Color.Value = 255; Gauge1.EndUpdate(); } </SCRIPT> </BODY>
VBScript
<BODY onload="Init()"> <OBJECT CLASSID="clsid:91628F12-393C-44EF-A558-83ED1790AAD3" id="Gauge1"></OBJECT> <SCRIPT LANGUAGE="VBScript"> Function Init() With Gauge1 .BeginUpdate .PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 1" .PicturesName = "`Layer` + int(value + 1) + `.png`" .Layers.Count = 5 With .Layers.Add("Solid") .Position = 1 .Width = "width/2" .Background.Color.Value = RGB(255,0,0) End With .EndUpdate End With End Function </SCRIPT> </BODY>
C# for /COM
axGauge1.BeginUpdate(); axGauge1.PicturesPath = "C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Knob 1"; axGauge1.PicturesName = "`Layer` + int(value + 1) + `.png`"; axGauge1.Layers.Count = 5; EXGAUGELib.Layer var_Layer = axGauge1.Layers.Add("Solid"); var_Layer.Position = 1; var_Layer.Width = "width/2"; var_Layer.Background.Color.Value = (uint)ColorTranslator.ToWin32(Color.FromArgb(255,0,0)); axGauge1.EndUpdate();
X++ (Dynamics Ax 2009)
public void init() { COM com_Background,com_Color,com_Layer; anytype var_Background,var_Color,var_Layer; ; super(); exgauge1.BeginUpdate(); exgauge1.PicturesPath("C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Knob 1"); exgauge1.PicturesName("`Layer` + int(value + 1) + `.png`"); exgauge1.Layers().Count(5); var_Layer = COM::createFromObject(exgauge1.Layers()).Add("Solid"); com_Layer = var_Layer; com_Layer.Position(1); com_Layer.Width("width/2"); var_Background = COM::createFromObject(com_Layer.Background()); com_Background = var_Background; var_Color = COM::createFromObject(com_Background).Color(); com_Color = var_Color; com_Color.Value(WinApi::RGB2int(255,0,0)); exgauge1.EndUpdate(); }
Delphi 8 (.NET only)
with AxGauge1 do begin BeginUpdate(); PicturesPath := 'C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 1'; PicturesName := '`Layer` + int(value + 1) + `.png`'; Layers.Count := 5; with Layers.Add('Solid') do begin Position := 1; Width := 'width/2'; Background.Color.Value := $ff; end; EndUpdate(); end
Delphi (standard)
with Gauge1 do begin BeginUpdate(); PicturesPath := 'C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 1'; PicturesName := '`Layer` + int(value + 1) + `.png`'; Layers.Count := 5; with Layers.Add('Solid') do begin Position := 1; Width := 'width/2'; Background.Color.Value := $ff; end; EndUpdate(); end
VFP
with thisform.Gauge1 .BeginUpdate .PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 1" .PicturesName = "`Layer` + int(value + 1) + `.png`" .Layers.Count = 5 with .Layers.Add("Solid") .Position = 1 .Width = "width/2" .Background.Color.Value = RGB(255,0,0) endwith .EndUpdate endwith
dBASE Plus
local oGauge,var_Layer oGauge = form.EXGAUGEACTIVEXCONTROL1.nativeObject oGauge.BeginUpdate() oGauge.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 1" oGauge.PicturesName = "`Layer` + int(value + 1) + `.png`" oGauge.Layers.Count = 5 var_Layer = oGauge.Layers.Add("Solid") var_Layer.Position = 1 var_Layer.Width = "width/2" var_Layer.Background.Color.Value = 0xff oGauge.EndUpdate()
XBasic (Alpha Five)
Dim oGauge as P Dim var_Layer as P oGauge = topparent:CONTROL_ACTIVEX1.activex oGauge.BeginUpdate() oGauge.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 1" oGauge.PicturesName = "`Layer` + int(value + 1) + `.png`" oGauge.Layers.Count = 5 var_Layer = oGauge.Layers.Add("Solid") var_Layer.Position = 1 var_Layer.Width = "width/2" var_Layer.Background.Color.Value = 255 oGauge.EndUpdate()
Visual Objects
local var_Layer as ILayer oDCOCX_Exontrol1:BeginUpdate() oDCOCX_Exontrol1:PicturesPath := "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 1" oDCOCX_Exontrol1:PicturesName := "`Layer` + int(value + 1) + `.png`" oDCOCX_Exontrol1:Layers:Count := 5 var_Layer := oDCOCX_Exontrol1:Layers:Add("Solid") var_Layer:Position := 1 var_Layer:Width := "width/2" var_Layer:Background:Color:Value := RGB(255,0,0) oDCOCX_Exontrol1:EndUpdate()
PowerBuilder
OleObject oGauge,var_Layer oGauge = ole_1.Object oGauge.BeginUpdate() oGauge.PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 1" oGauge.PicturesName = "`Layer` + int(value + 1) + `.png`" oGauge.Layers.Count = 5 var_Layer = oGauge.Layers.Add("Solid") var_Layer.Position = 1 var_Layer.Width = "width/2" var_Layer.Background.Color.Value = RGB(255,0,0) oGauge.EndUpdate()
Visual DataFlex
Procedure OnCreate Forward Send OnCreate Send ComBeginUpdate Set ComPicturesPath to "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 1" Set ComPicturesName to "`Layer` + int(value + 1) + `.png`" Variant voLayers Get ComLayers to voLayers Handle hoLayers Get Create (RefClass(cComLayers)) to hoLayers Set pvComObject of hoLayers to voLayers Set ComCount of hoLayers to 5 Send Destroy to hoLayers Variant voLayers1 Get ComLayers to voLayers1 Handle hoLayers1 Get Create (RefClass(cComLayers)) to hoLayers1 Set pvComObject of hoLayers1 to voLayers1 Variant voLayer Get ComAdd of hoLayers1 "Solid" to voLayer Handle hoLayer Get Create (RefClass(cComLayer)) to hoLayer Set pvComObject of hoLayer to voLayer Set ComPosition of hoLayer to 1 Set ComWidth of hoLayer to "width/2" Variant voBackground Get ComBackground of hoLayer to voBackground Handle hoBackground Get Create (RefClass(cComBackground)) to hoBackground Set pvComObject of hoBackground to voBackground Variant voColor Get ComColor of hoBackground to voColor Handle hoColor Get Create (RefClass(cComColor)) to hoColor Set pvComObject of hoColor to voColor Set ComValue of hoColor to (RGB(255,0,0)) Send Destroy to hoColor Send Destroy to hoBackground Send Destroy to hoLayer Send Destroy to hoLayers1 Send ComEndUpdate End_Procedure
XBase++
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oGauge LOCAL oLayer oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oGauge := XbpActiveXControl():new( oForm:drawingArea ) oGauge:CLSID := "Exontrol.Gauge.1" /*{91628F12-393C-44EF-A558-83ED1790AAD3}*/ oGauge:create(,, {10,60},{610,370} ) oGauge:BeginUpdate() oGauge:PicturesPath := "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob 1" oGauge:PicturesName := "`Layer` + int(value + 1) + `.png`" oGauge:Layers():Count := 5 oLayer := oGauge:Layers():Add("Solid") oLayer:Position := 1 oLayer:Width := "width/2" oLayer:Background():Color():SetProperty("Value",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oGauge:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN