From Clomosy Docs

No edit summary
No edit summary
Line 3: Line 3:
</div>
</div>


<span style="color:blue"><b>AComponent</b></span> : The variable name of the defined component is written. Here you should write the component variable name of whatever your component will be in.<br>
<span style="color:blue"><b>AComponent</b></span> : Specifies the parent of the object to be defined.<br>


<span style="color:blue"><b>xName</b></span> : The name of the defined image should be written.<br>
<span style="color:blue"><b>xName</b></span> : The name of the defined image should be written.<br>

Revision as of 13:51, 14 November 2024

AComponent : Specifies the parent of the object to be defined.

xName : The name of the defined image should be written.


TclProImage is used to add an image to a form. Adding visuals to an application makes it more attractive and user-friendly.
All of the TclImage features are available. Apart from this, border color, rounding borders, image stretching and fitting features are available.

Feature Use of Definition
TclProImage ProImage1 : TclProImage; A variable belonging to the TclProImage class is created.
AddNewProImage ProImage1 = Form1.AddNewProImage(Form1,'ProImage1'); A new image is added to the form.

In addition to the features of a standard image, TclProImage offers new and advanced features, which we will explain in detail below.

clProSettings Properties

  • BorderColor
  • BorderWidth
  • BackgroundColor
  • IsTransparent
  • IsFill
  • IsRound
  • RoundHeight
  • RoundWidth
  • PictureAutoFit
  • PictureStretch
  • PictureSource
  • SetupComponent Properties

  • Width
  • Height
  • PositionX
  • PositionY
  • Align
  • BackgroundColor
  • MarginTop
  • MarginBottom
  • MarginRight
  • MarginLeft
  • RoundHeight
  • RoundWidth
  • BorderColor
  • BorderWidth
  • ImgFit
  • ImgStretch
  • ImgUrl

  • Example

    For clProSettings:

    Var   
      Form1:TclForm;
      ProImg1: TClProImage;
    
    void SetImage;
    {
      ProImg1 = Form1.AddNewProImage(Form1,'ProImg1');
      ProImg1.Align = alCenter;
      ProImg1.Width = 150;
      ProImg1.Height = 150;
      ProImg1.clProSettings.BorderColor = clAlphaColor.clHexToColor('#fabd2');
      ProImg1.clProSettings.RoundHeight = 10;
      ProImg1.clProSettings.RoundWidth = 10;
      ProImg1.clProSettings.BorderWidth = 2;
      ProImg1.clProSettings.IsFill = True; 
      ProImg1.clProSettings.IsRound = True;
      ProImg1.clProSettings.PictureSource = 'https://clomosy.com/demos/computerNetwork.png';
      ProImg1.clProSettings.PictureAutoFit = True;
      ProImg1.SetclProSettings(ProImg1.clProSettings);
    }
    
    {
      Form1 = TclForm.Create(Self);
      SetImage;
      Form1.Run;
    }
    

    For SetupComponent:

    Var   
      Form1:TclForm;
      ProImg1: TClProImage;
    
    void SetImage;
    {
      ProImg1 = Form1.AddNewProImage(Form1,'ProImg1');
      clComponent.SetupComponent(ProImg1,'{
      "Align" : "Center",
      "Width":150,
      "Height":150,
      "BorderColor":"#fabd2",
      "BorderWidth":2,
      "RoundHeight":10,
      "RoundWidth":10,		
      "ImgUrl":"https://clomosy.com/demos/computerNetwork.png",
      "ImgFit":"yes"
    }');
    }
    
    {
      Form1 = TclForm.Create(Self);
      SetImage;
      Form1.Run;
    }
    

    Output:
    ProImage.png

    See Also