Skip to main content
18-Opal
June 25, 2021
Solved

How to create thumbnail(or image or preview) in table cell

  • June 25, 2021
  • 1 reply
  • 1968 views

Hi,

 

Create the Table UI using the C++ Toolkit.
The rows in the table display the components of the active assembly in a level structure.
Each row displays the name and information of the component.

 

Now we need to display the visual element of the component corresponding to the selected row.
How can I display a visual element (Thumbnail or Image) of a selected component?

 

If you have any good ideas, please share them.

Best answer by RPN

The sample is completely written in Tcl/Tk, using Toolkit in the Background, and in Tk you can use a couple of widgets, e.g. Label, Button, Tree, TreeCntl, Ckeckbutton .. to display an image from file.

 

In Tcl I can use

 

ps_utile image_write -width100 -height 100 -type jpeg -dpi 400 -model box.prt — c:/temp/box.prt.jpg

As far I see the ProRasterFileWrite function has very similar options, only the model option is replaced, because the window ID is searched by the given model.

 

It is by far easier and much faster in Tk to create an Interface. 

Good Luck 😀

 

1 reply

RPN
18-Opal
June 26, 2021

Something like this , here the image will use the model stamp info, to make sure the image is the one which needs to be displayed, start at 11:51. The whole interface developed in 4 hours, I guess you may need for such an interface multiples of this 😀.

 

The PTC tree can display labels, and a label is capable to show a bitmap, this is probably what you need.

CHASEONHO18-OpalAuthor
18-Opal
June 27, 2021

Hi,

That's a good video.


When displaying the image in the video above, are you using ProRasterFileWrite to save the image and then display it?

 

Thanks.


Warm Regards,

SeonHo Cha.

RPN
RPN18-OpalAnswer
18-Opal
June 28, 2021

The sample is completely written in Tcl/Tk, using Toolkit in the Background, and in Tk you can use a couple of widgets, e.g. Label, Button, Tree, TreeCntl, Ckeckbutton .. to display an image from file.

 

In Tcl I can use

 

ps_utile image_write -width100 -height 100 -type jpeg -dpi 400 -model box.prt — c:/temp/box.prt.jpg

As far I see the ProRasterFileWrite function has very similar options, only the model option is replaced, because the window ID is searched by the given model.

 

It is by far easier and much faster in Tk to create an Interface. 

Good Luck 😀