1. Joshua Woon
  2. PowerBuilder
  3. Friday, 23 February 2018 10:37 AM UTC

I've a N-up datawindow that I would like to place a picture control. How can I control that display of the picture control so that it only appears for those row/column that has data element?

How do I modify the PictureName property of the picture control? I want to dynamically assign the PictureName (or read it from the database).

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 23 February 2018 15:14 PM UTC
  2. PowerBuilder
  3. # 1

Hi Joshua;

  If you are on a newer version of PB - like 12.6 or 2017 - I would suggest using the INK control instead of the picture control for more control over the image display. Also, I would suggest that you use the new TableBLOB DataWindow feature. The TB allows you to have the DW object handle the SelectBlob directly vs you coding it. TB controls can be set to behave like Ink Picture, RTE or an XPS document against the binary datastream - for example:

1) Add the TB column

2) Then select its use ...

 

HTH

Regards ... Chris

Comment
There are no comments made yet.
Marco Meoni Accepted Answer Pending Moderation
  1. Friday, 23 February 2018 12:56 PM UTC
  2. PowerBuilder
  3. # 2

Hello Joshua,

instead of a picture object, I would simply add a computed field containing the following expression

Bitmap('myfolder\' + String( pictureID ) + '.jpg')

That will display any jpeg according, for example, to the pictureID column that you have on the row.

Now, making it (in)visible is easy, just add a boolean condition to the Visible property of the computed field.

HTH.

Cheers,

Marco

Comment
  1. Manuel Reyes
  2. Tuesday, 20 April 2021 15:09 PM UTC
Thanks, i was search this long time, it's perfect with a pictures out of database.
  1. Helpful
  1. Olan Knight
  2. Thursday, 22 April 2021 15:11 PM UTC
That is slick, Marco! Thanks for sharing!
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.