picturebox vs imagview
Posted
#1
(In Topic #334)
Regular

- What are the differences between these two controls?
- What file types are supported?
I'm looking to display image/document files 'in-programme'.
Thank you
Gambas 3.14
Posted
Guru

I'm looking to display image/document files 'in-programme'.
If this means that you have a quantity of files that you can load to display and you don't need to manipulate them then I suggest PictureBoxes.
Unless somebody knows otherwise……
Posted
Regular

Control (gb.qt4)
Container (gb.qt4)
DrawingArea (gb.qt4)
PictureBox (gb.qt4) http://gambaswiki.org/wiki/comp/gb.qt4/picturebox
Property Image As Image
Property Picture As Picture
Control (gb.qt4)
Container (gb.qt4)
UserControl (gb.qt4)
ImageView (gb.form) http://gambaswiki.org/wiki/comp/gb.form/imageview
Property Image As Image
Not having used either yet, the most interesting difference I can see is that PictureBox descends from DrawingArea:
http://gambaswiki.org/wiki/comp/gb.qt4/drawingareaThis control implements an area that can be drawn by the application. It has two behaviors, standard and cached, defined by the Cached property.
In standard mode, The DrawingArea will raise the Draw event each time it needs to be refreshed.
In cached mode, The drawing is done once, by using the DrawingArea control as a drawing device. This drawing is stored inside an internal Picture that is used by the DrawingArea to refresh itself.
By default, the drawing must be done by using the Draw class. If you set the Painted property, the drawing will have to be done by the Paint class, and so will be anti-aliased.
Since 3.4
The Painted is useless and therefore deprecated since Gambas 3.4.
So, as cogier points out that PictureBox loads the picture from disk, ImageView seems to generate the Image from programming instructions, although it does have a Picture property too.
No clue about the formats.
Posted
Regular

I'll find out one way or another which file type are supported and report them here.
1 guest and 0 members have just viewed this.


