/ Forums / Advansys Formativ / Creating Solutions with Formativ / Changing picture of TImage

  • Creator
    Topic
  • #4422
    stschaefer
    Participant

    I want to do something quite simple:
    Changing the picture of a TImage component, but it doesn’t work. (No image is loaded.) I reduced the code to the lines below. No errors occur. The image does exists at the given location.

    Maybe you have an idea? Smile

     OPTION EXPLICIT
    Sub Main(Client, GWEvent)
    form.ShowModal()
    End Sub

    Sub btnClick(Sender)
    form.img.Picture = LoadPicture("D:0.bmp")
    End Sub
  • Author
    Replies
  • #8136
    Support 3
    Participant

    Use TImage.Picture.LoadFromFile() method, see the modified code below.

     
    Sub Main(Client, GWEvent)
       form.ShowModal()
    End Sub
    
    Sub btnClick(Sender)
       form.img.Picture.LoadFromFile("D:0.bmp")
    End Sub 
     

    Regards,
    Advansys Support

    #8138
    stschaefer
    Participant

    Thank you for your quick response.

    The code you provided works perfectly. Smile

    #8137
    Support 3
    Participant

    Glad to help.

    Regards,
    Advansys Support

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.