From Clomosy Docs
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert"> | |||
procedure ImageChooser(AComponent, TargetComponent: TCLComponent); | |||
</div> | |||
<span style="color:blue"><b>AComponent</b></span> : The ImageChooser operation's main component parameter indicates the component where the operation will be executed. It is recommended to use it on a form.<br> | |||
<span style="color:blue"><b>TargetComponent</b></span> : This parameter represents the target component where the image will be assigned. TargetComponent is typically a component capable of displaying an image.<br> | |||
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> | |||
After the selected or taken image is saved, it is added into the created image object on the form.<br> | |||
<b>Example</b><br> | |||
<pre> | |||
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; | |||
} | |||
</pre> | |||
<h2> See Also </h2> | |||
* [[Components]] | |||
* [[Object Properties]] | |||
* [[AddNewEvent]] | |||
Revision as of 14:42, 14 November 2024
procedure ImageChooser(AComponent, TargetComponent: TCLComponent);
AComponent : The ImageChooser operation's main component parameter indicates the component where the operation will be executed. It is recommended to use it on a form.
TargetComponent : This parameter represents the target component where the image will be assigned. TargetComponent is typically a component capable of displaying an image.
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;
}