From Clomosy Docs

(Created page with "The "ImageChooser" feature allows users within the project to select an image from their galleries or file systems and take a photo from the camera. Clomosy.ImageChooser(TclForm, TclImage); The first parameter represents the form where the image object is located. The second parameter specifies the image object where the captured or selected photo will be placed. After the selected or taken image is saved, it is added into the created image object on the form. '''E...")
 
No edit summary
Line 8: Line 8:


'''Example:'''
'''Example:'''
:''Basic Syntax''
  var
  var
   myForm:TclForm;
   myForm:TclForm;
Line 34: Line 35:
   
   
  End;
  End;
:''TRObject Syntax''
var
myForm:TclForm;
CameraBtn:TclButton;
CameraImg:TClImage;
void onbtnClick;
{
  Clomosy.ImageChooser(MyForm, CameraImg);
}
{
myForm = TClForm.Create(Self);
CameraBtn = myForm.AddNewButton(MyForm, 'CameraBtn','Open the Camera');
MyForm.AddNewEvent(CameraBtn, tbeOnClick, 'onbtnClick');
CameraBtn.Align = alBottom;
CameraImg = myForm.AddNewImage(MyForm, 'CameraImg');
MyForm.setImage(CameraImg,'https://clomosy.com/demos/balloon.png');
CameraImg.Align = alCenter;
CameraImg.Height = 300;
CameraImg.Width = 300;
myForm.Run;
}

Revision as of 10:17, 5 December 2023

The "ImageChooser" feature allows users within the project to select an image from their galleries or file systems and take a photo from the camera.

 Clomosy.ImageChooser(TclForm, TclImage);

The first parameter represents the form where the image object is located. The second parameter specifies the image object where the captured or selected photo will be placed.

After the selected or taken image is saved, it is added into the created image object on the form.

Example:

Basic Syntax
var
 myForm:TclForm;
 CameraBtn:TclButton;
 CameraImg:TClImage;

 Procedure onbtnClick;
 begin
   Clomosy.ImageChooser(MyForm, CameraImg);
 End;

begin

 myForm := TClForm.Create(Self);
 CameraBtn := myForm.AddNewButton(MyForm, 'CameraBtn','Open the Camera');
 MyForm.AddNewEvent(CameraBtn, tbeOnClick, 'onbtnClick');
 CameraBtn.Align := alBottom;

 CameraImg := myForm.AddNewImage(MyForm, 'CameraImg');
MyForm.setImage(CameraImg,'https://clomosy.com/demos/balloon.png');
 CameraImg.Align := alCenter;
 CameraImg.Height := 300;
 CameraImg.Width := 300;

 myForm.Run;

End;
TRObject Syntax
var
myForm:TclForm;
CameraBtn:TclButton;
CameraImg:TClImage;

void onbtnClick;
{
  Clomosy.ImageChooser(MyForm, CameraImg);
}

{

myForm = TClForm.Create(Self);
CameraBtn = myForm.AddNewButton(MyForm, 'CameraBtn','Open the Camera');
MyForm.AddNewEvent(CameraBtn, tbeOnClick, 'onbtnClick');
CameraBtn.Align = alBottom;

CameraImg = myForm.AddNewImage(MyForm, 'CameraImg');

MyForm.setImage(CameraImg,'https://clomosy.com/demos/balloon.png');
CameraImg.Align = alCenter;
CameraImg.Height = 300;
CameraImg.Width = 300;

myForm.Run;

}