1. King Fook Developer-01
  2. PowerBuilder
  3. Friday, 2 December 2022 10:56 AM UTC

Hi,

I have a datawindow and set a column (Display As Picture) to show the item photo based on returned data.

I would like to ask how to show the picture with proper ratio?

Thank you.

King Fook Developer-01 Accepted Answer Pending Moderation
  1. Monday, 5 December 2022 02:22 AM UTC
  2. PowerBuilder
  3. # 1

Thank you for your reply. I use "Display as Picture" in datawindow so that there is no "Original size" option for the object. If I use picture object in datawindow, how can I dynamic change the picture filename in each row? Thank you!

Comment
  1. Chris Pollach @Appeon
  2. Monday, 5 December 2022 02:43 AM UTC
Hi King;

Just use a SetItem() command to change the picture name value on that column.

Regards ... Chris
  1. Helpful
  1. Miguel Leeuwe
  2. Monday, 5 December 2022 07:33 AM UTC
You can use the Modify() function if you have a picture object.
  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Friday, 2 December 2022 22:30 PM UTC
  2. PowerBuilder
  3. # 2

if you use a picture control on the datawindow, you can have it use the 'original size'.  That is the closest thing you have directly in the datawindow to sort of tell you what the aspect ratio is.

 

Using that, or some other process, you would need to calculate the size (width/height) and use that to determine the aspect ratio.  At runtime you would have to change the width/height of the column/compute based on that ratio to get it to display correctly.

 

you should send appeon an enhancement request to have the datawindow to do that automatically (keep the aspect ratio)

 

 

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 2 December 2022 19:49 PM UTC
  2. PowerBuilder
  3. # 3

Hi King;

  Is your DataWindow using the following approach ...

  • A Column where the "Display as Picture" property is set.
  • A real Image object control within the DWO
  • Table BLOB type DWO

Regards ... Chris

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 2 December 2022 17:16 PM UTC
  2. PowerBuilder
  3. # 4

Hi,

Make sure all of your pictures have the same width x height ratios.

Set your datawindow to pixels instead of PB Units.

Adjust the size in pixels of the column to be exactly the same as the picture's. (or at least the same proportions).

regards,

MiguelL

Comment
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.