Type | Description | |||
Long | A Long expression that indicates the index of the layer that determines the size to display all layers |
For instance, you can use the LayerAutoSize property to:
The following properties determines the position / size / offset of the layer:
You can use the following properties to offset the view ( background + foreground ) inside the layer:
The following properties can be used to move / resize the picture on the layer's background:
The following samples show how you can resize the control's view to 164 x 164 pixels, by adding a new hidden layer called "autosize":
VBA (MS Access, Excell...)
With Gauge1 .BeginUpdate .PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob" .PicturesName = "`Layer` + int(value + 1) + `.png`" .Layers.Count = 10 With .Layers.Add("autosize") .Visible = False .Width = 164 .Height = 164 End With .LayerAutoSize = .Layers.Item("autosize").Index .EndUpdate End With
VB6
With Gauge1 .BeginUpdate .PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob" .PicturesName = "`Layer` + int(value + 1) + `.png`" .Layers.Count = 10 With .Layers.Add("autosize") .Visible = False .Width = 164 .Height = 164 End With .LayerAutoSize = .Layers.Item("autosize").Index .EndUpdate End With
VB.NET
With Exgauge1 .BeginUpdate() .PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob" .PicturesName = "`Layer` + int(value + 1) + `.png`" .Layers.Count = 10 With .Layers.Add("autosize") .Visible = False .Width = 164 .Height = 164 End With .LayerAutoSize = .Layers.Item("autosize").Index .EndUpdate() End With
VB.NET for /COM
With AxGauge1 .BeginUpdate() .PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob" .PicturesName = "`Layer` + int(value + 1) + `.png`" .Layers.Count = 10 With .Layers.Add("autosize") .Visible = False .Width = 164 .Height = 164 End With .LayerAutoSize = .Layers.Item("autosize").Index .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"); spGauge1->PutPicturesName(L"`Layer` + int(value + 1) + `.png`"); spGauge1->GetLayers()->PutCount(10); EXGAUGELib::ILayerPtr var_Layer = spGauge1->GetLayers()->Add("autosize"); var_Layer->PutVisible(VARIANT_FALSE); var_Layer->PutWidth(L"164"); var_Layer->PutHeight(L"164"); spGauge1->PutLayerAutoSize(spGauge1->GetLayers()->GetItem("autosize")->GetIndex()); spGauge1->EndUpdate();
C++ Builder
Gauge1->BeginUpdate(); Gauge1->PicturesPath = L"C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Knob"; Gauge1->PicturesName = L"`Layer` + int(value + 1) + `.png`"; Gauge1->Layers->Count = 10; Exgaugelib_tlb::ILayerPtr var_Layer = Gauge1->Layers->Add(TVariant("autosize")); var_Layer->Visible = false; var_Layer->Width = L"164"; var_Layer->Height = L"164"; Gauge1->LayerAutoSize = Gauge1->Layers->get_Item(TVariant("autosize"))->Index; Gauge1->EndUpdate();
C#
exgauge1.BeginUpdate(); exgauge1.PicturesPath = "C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Knob"; exgauge1.PicturesName = "`Layer` + int(value + 1) + `.png`"; exgauge1.Layers.Count = 10; exontrol.EXGAUGELib.Layer var_Layer = exgauge1.Layers.Add("autosize"); var_Layer.Visible = false; var_Layer.Width = 164.ToString(); var_Layer.Height = 164.ToString(); exgauge1.LayerAutoSize = exgauge1.Layers["autosize"].Index; 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"; Gauge1.PicturesName = "`Layer` + int(value + 1) + `.png`"; Gauge1.Layers.Count = 10; var var_Layer = Gauge1.Layers.Add("autosize"); var_Layer.Visible = false; var_Layer.Width = 164; var_Layer.Height = 164; Gauge1.LayerAutoSize = Gauge1.Layers.Item("autosize").Index; 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" .PicturesName = "`Layer` + int(value + 1) + `.png`" .Layers.Count = 10 With .Layers.Add("autosize") .Visible = False .Width = 164 .Height = 164 End With .LayerAutoSize = .Layers.Item("autosize").Index .EndUpdate End With End Function </SCRIPT> </BODY>
C# for /COM
axGauge1.BeginUpdate(); axGauge1.PicturesPath = "C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Knob"; axGauge1.PicturesName = "`Layer` + int(value + 1) + `.png`"; axGauge1.Layers.Count = 10; EXGAUGELib.Layer var_Layer = axGauge1.Layers.Add("autosize"); var_Layer.Visible = false; var_Layer.Width = 164.ToString(); var_Layer.Height = 164.ToString(); axGauge1.LayerAutoSize = axGauge1.Layers["autosize"].Index; axGauge1.EndUpdate();
X++ (Dynamics Ax 2009)
public void init() { COM com_Layer; anytype var_Layer; ; super(); exgauge1.BeginUpdate(); exgauge1.PicturesPath("C:\\Program Files\\Exontrol\\ExGauge\\Sample\\Design\\Circular\\Knob"); exgauge1.PicturesName("`Layer` + int(value + 1) + `.png`"); exgauge1.Layers().Count(10); var_Layer = COM::createFromObject(exgauge1.Layers()).Add("autosize"); com_Layer = var_Layer; com_Layer.Visible(false); com_Layer.Width(164); com_Layer.Height(164); exgauge1.LayerAutoSize(exgauge1.Layers().Item("autosize").Index()); exgauge1.EndUpdate(); }
Delphi 8 (.NET only)
with AxGauge1 do begin BeginUpdate(); PicturesPath := 'C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob'; PicturesName := '`Layer` + int(value + 1) + `.png`'; Layers.Count := 10; with Layers.Add('autosize') do begin Visible := False; Width := 164; Height := 164; end; LayerAutoSize := Layers.Item['autosize'].Index; EndUpdate(); end
Delphi (standard)
with Gauge1 do begin BeginUpdate(); PicturesPath := 'C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob'; PicturesName := '`Layer` + int(value + 1) + `.png`'; Layers.Count := 10; with Layers.Add('autosize') do begin Visible := False; Width := 164; Height := 164; end; LayerAutoSize := Layers.Item['autosize'].Index; EndUpdate(); end
VFP
with thisform.Gauge1 .BeginUpdate .PicturesPath = "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob" .PicturesName = "`Layer` + int(value + 1) + `.png`" .Layers.Count = 10 with .Layers.Add("autosize") .Visible = .F. .Width = 164 .Height = 164 endwith .LayerAutoSize = .Layers.Item("autosize").Index .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" oGauge.PicturesName = "`Layer` + int(value + 1) + `.png`" oGauge.Layers.Count = 10 var_Layer = oGauge.Layers.Add("autosize") var_Layer.Visible = false var_Layer.Width = Str(164) var_Layer.Height = Str(164) oGauge.LayerAutoSize = oGauge.Layers.Item("autosize").Index 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" oGauge.PicturesName = "`Layer` + int(value + 1) + `.png`" oGauge.Layers.Count = 10 var_Layer = oGauge.Layers.Add("autosize") var_Layer.Visible = .f. var_Layer.Width = 164 var_Layer.Height = 164 oGauge.LayerAutoSize = oGauge.Layers.Item("autosize").Index oGauge.EndUpdate()
Visual Objects
local var_Layer as ILayer oDCOCX_Exontrol1:BeginUpdate() oDCOCX_Exontrol1:PicturesPath := "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob" oDCOCX_Exontrol1:PicturesName := "`Layer` + int(value + 1) + `.png`" oDCOCX_Exontrol1:Layers:Count := 10 var_Layer := oDCOCX_Exontrol1:Layers:Add("autosize") var_Layer:Visible := false var_Layer:Width := AsString(164) var_Layer:Height := AsString(164) oDCOCX_Exontrol1:LayerAutoSize := oDCOCX_Exontrol1:Layers:[Item,"autosize"]:Index 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" oGauge.PicturesName = "`Layer` + int(value + 1) + `.png`" oGauge.Layers.Count = 10 var_Layer = oGauge.Layers.Add("autosize") var_Layer.Visible = false var_Layer.Width = String(164) var_Layer.Height = String(164) oGauge.LayerAutoSize = oGauge.Layers.Item("autosize").Index oGauge.EndUpdate()
Visual DataFlex
Procedure OnCreate Forward Send OnCreate Send ComBeginUpdate Set ComPicturesPath to "C:\Program Files\Exontrol\ExGauge\Sample\Design\Circular\Knob" 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 10 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 "autosize" to voLayer Handle hoLayer Get Create (RefClass(cComLayer)) to hoLayer Set pvComObject of hoLayer to voLayer Set ComVisible of hoLayer to False Set ComWidth of hoLayer to 164 Set ComHeight of hoLayer to 164 Send Destroy to hoLayer Send Destroy to hoLayers1 Variant v Variant voLayers2 Get ComLayers to voLayers2 Handle hoLayers2 Get Create (RefClass(cComLayers)) to hoLayers2 Set pvComObject of hoLayers2 to voLayers2 Variant voLayer1 Get ComItem of hoLayers2 "autosize" to voLayer1 Handle hoLayer1 Get Create (RefClass(cComLayer)) to hoLayer1 Set pvComObject of hoLayer1 to voLayer1 Get ComIndex of hoLayer1 to v Send Destroy to hoLayer1 Send Destroy to hoLayers2 Set ComLayerAutoSize to v 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" oGauge:PicturesName := "`Layer` + int(value + 1) + `.png`" oGauge:Layers():Count := 10 oLayer := oGauge:Layers():Add("autosize") oLayer:Visible := .F. oLayer:Width := Transform(164,"") oLayer:Height := Transform(164,"") oGauge:LayerAutoSize := oGauge:Layers:Item("autosize"):Index() oGauge:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN