GefObjects.AddImage (method)

Creates and returns a new Image object in this container.
Syntax: Set GefObject = object.AddImage ( FileName, InsertAsLink, Left, Top, Width, Height )
FileName As String -
Optional InsertAsLink As Boolean -
Optional Left As long -
Optional Top As long -
Optional Width As long -
Optional Height As long -
Description: The AddImage method adds a new Image object to the current container.
If Width and Height are not specified then the image will be of original dimensions.
For relative paths to work we may need to set the current directory using ChDir
before calling the AddImage


Sub GefObjects_AddImage()
    Dim oCimScr As GefScreen
    Dim oCimObj As GefObject
    Dim oCimObjs As GefObjects
    Dim oCimBtnObj As GefObject
    Set oCimScr = CimGetScreen
    Set oCimObj = oCimScr.Object
    Set oCimObjs = oCimObj.Objects
    Set oCimBtnObj = oCimObjs.AddImage("D:\MyImages\MyImage.jpg", False, "120 * 20, 120 * 20, 120 * 20, 120 * 20)
    oCimScr.Refresh False
End Sub