Search code examples
delphifiremonkeydelphi-10.4-sydney

How can I stretch a Image displayed on a TGlyph to the size of the TGlyph in a Multi Device Application?


TGlyph Object

The TGlyph has a Stretch boolean value, but on change it does not appear to change anything.


Solution

  • When you set Stretch = True the image is stretched but maintains the original aspect ratio.

    In your image, the height is the limiting factor. If you change the height of your TGlyph you will see that the height of the image also changes (in addition to the width, until it becomes the limiting factor).

    TGlyph doesn't provide means to change aspect ratio.


    Edit:

    I suggest you try a TRectangtle component (under Shapes in Tool Palette). It has a Fill property that you can set to a gradient or bitmap. Maybe the gradient option is ok for you without an image.

    But if you set its Fill.Kind to Bitmap and load a bitmap, you can set its WrapMode property to TileStretch and then it will grow / shrink independently in horizontal and vertical direction.

    E.g.:

    enter image description here