var
MyForm: TCLForm;
CompassImg,DirectionImg: TClProImage;
GetTimer: TClTimer;
CompassXLabel,CompassYLabel,CompassZLabel : TclLabel;
void GetCompass;
var
currentYHeading,currentXHeading,currentZHeading: Double;
rotationAngle: Double;
{
if (not MyForm.FormOrientationSensor.Sensor == nil)
{
currentYHeading = MyForm.FormOrientationSensor.Sensor.HeadingY;
currentXHeading = MyForm.FormOrientationSensor.Sensor.HeadingX;
currentZHeading = MyForm.FormOrientationSensor.Sensor.HeadingZ;
CompassXLabel.Text = 'X : '+FloatToStr(Abs(currentXHeading));
CompassYLabel.Text = 'Y : '+FloatToStr(Abs(currentYHeading));
CompassZLabel.Text = 'Z : '+FloatToStr(Abs(currentZHeading));
}
CompassImg.RotationAngle = currentYHeading;
}
{
MyForm = TCLForm.Create(Self);
MyForm.SetFormBGImage(' https://clomosy.com/demos/compassbg.png" rel="nofollow - https://clomosy.com/demos/compassbg.png' );
CompassXLabel = MyForm.AddNewLabel(MyForm,'CompassXLabel','--');
CompassXLabel.Align = alBottom;
CompassXLabel.Margins.Bottom= 30;
CompassXLabel.Height = 50;
CompassXLabel.Width = 150;
CompassYLabel = MyForm.AddNewLabel(MyForm,'CompassYLabel','--');
CompassYLabel.Align = alBottom;
CompassYLabel.Margins.Bottom= 20;
CompassYLabel.Height = 50;
CompassYLabel.Width = 150;
CompassZLabel = MyForm.AddNewLabel(MyForm,'CompassZLabel','--');
CompassZLabel.Align = alBottom;
CompassZLabel.Margins.Bottom= 10;
CompassZLabel.Height = 50;
CompassZLabel.Width = 150;
CompassImg = MyForm.AddNewProImage(MyForm,'CompassImg');
clComponent.SetupComponent(CompassImg,'{"Align" : "Center","Width":350,"Height":350,"ImgUrl":" https://clomosy.com/demos/compass2.png" rel="nofollow - https://clomosy.com/demos/compass2.png ", "ImgFit":"yes"}');
DirectionImg = MyForm.AddNewProImage(MyForm,'DirectionImg');
clComponent.SetupComponent(DirectionImg,'{"Align" : "Center","Width":350,"Height":350,"ImgUrl":" https://clomosy.com/demos/compass_arrow2.png" rel="nofollow - https://clomosy.com/demos/compass_arrow2.png ", "ImgFit":"yes","MarginBottom":100,"MarginRight":28}');
MyForm.FormOrientationSensorType = ostHeading;
MyForm.FormOrientationSensor.Active = True;
GetTimer = MyForm.AddNewTimer(MyForm, 'GetTimer', 500);
GetTimer.Enabled = True;
MyForm.AddNewEvent(GetTimer, tbeOnTimer, 'GetCompass');
MyForm.Run;
} Bilgisayar üzerinden, Clomosylearn uygulaması ile açıldığında sürekli RUNTİME hatası alıyorum. Kodlarım yukarıda belirttiğim gibi. Hata kodu aşağıda yer alıyor.
|