From Clomosy Docs

No edit summary
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
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.
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert">
procedure ImageChooser(Sender:TclForm; ImageViewer:TClImage);
</div>


  Clomosy.ImageChooser(TclForm, TclImage);
<span style="color:blue"><b>Sender</b></span> : The main component parameter of the ImageChooser operation specifies the form on which the operation will be executed.<br>


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.
<span style="color:blue"><b>ImageViewer</b></span> : This parameter represents the target component where the image will be assigned.<br>


After the selected or taken image is saved, it is added into the created image object on the form.
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.<br>


'''Example:'''
After the selected or taken image is saved, it is added into the created image object on the form.<br>


var
<b>Example</b><br>
myForm:TclForm;
<pre>
CameraBtn:TclButton;
var
CameraImg:TClImage;
myForm:TclForm;
CameraBtn:TclButton;
void onbtnClick;
CameraImg:TClImage;
{
 
  Clomosy.ImageChooser(MyForm, CameraImg);
void onbtnClick;
}
{
  Clomosy.ImageChooser(MyForm, CameraImg);
{
}
 
myForm = TClForm.Create(Self);
{
CameraBtn = myForm.AddNewButton(MyForm, 'CameraBtn','Open the Camera');
 
MyForm.AddNewEvent(CameraBtn, tbeOnClick, 'onbtnClick');
myForm = TClForm.Create(Self);
CameraBtn.Align = alBottom;
CameraBtn = myForm.AddNewButton(MyForm, 'CameraBtn','Open the Camera');
MyForm.AddNewEvent(CameraBtn, tbeOnClick, 'onbtnClick');
CameraImg = myForm.AddNewImage(MyForm, 'CameraImg');
CameraBtn.Align = alBottom;
 
MyForm.setImage(CameraImg,'https://clomosy.com/demos/balloon.png');
CameraImg = myForm.AddNewImage(MyForm, 'CameraImg');
CameraImg.Align = alCenter;
 
CameraImg.Height = 300;
MyForm.setImage(CameraImg,'https://clomosy.com/demos/balloon.png');
CameraImg.Width = 300;
CameraImg.Align = alCenter;
CameraImg.Height = 300;
myForm.Run;
CameraImg.Width = 300;
 
}
myForm.Run;
 
}
</pre>
 
<h2> See Also </h2>
* [[Components]]
* [[Object Properties]]
* [[AddNewEvent]]
{{#seo:|title=Camera Access Using in Clomosy - Clomosy Docs}}
{{#seo:|description=ImageChooser enables users to select an image from their gallery, file system, or capture a photo with the camera, and displays it on the target component.}}

Latest revision as of 15:03, 10 April 2025

Sender : The main component parameter of the ImageChooser operation specifies the form on which the operation will be executed.

ImageViewer : This parameter represents the target component where the image will be assigned.

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.

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

Example

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;

}

See Also