From Clomosy Docs
No edit summary |
ClomosyAdmin (talk | contribs) No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 37: | Line 37: | ||
* [[TclForm | TclForm]] | * [[TclForm | TclForm]] | ||
* [[TclImage | TclImage]] | * [[TclImage | TclImage]] | ||
{{#seo:|title=SetImage in Clomosy - Clomosy Docs}} | |||
{{#seo:|description=Explore SetImage in Clomosy! Simplify image handling in your app, optimizing the display of visual content for better engagement.}} | |||
Latest revision as of 13:14, 24 December 2024
procedure SetImage(xComponent:TCLComponent,'xImageFile');
xComponent : The variable name of the defined component is written.
xImageFile : You must add a string type url address to this field. You may encounter an error when the url address is not an image.
It is a procedure used to display an image in visual components.
Example
Now let's see the code part. Let's define the image variable. After that, let's create a field in the Form (AddNewImage) and add an image (SetImage).
var
MyForm:TclForm;
testImg : TclImage;
{
MyForm = TclForm.Create(Self);
testImg= MyForm.AddNewImage(MyForm,'testImg');
testImg.Align = alClient;
testImg.Height = 250;
testImg.Width = 300;
MyForm.setImage(testImg,'https://clomosy.com/demos/bg.png');
MyForm.AddNewEvent(testImg,tbeOnClick,'ShowMessage(''Background design..'');');
MyForm.Run;
}