5

When I try the following code:

namedWindow("My Window");
createTrackbar("Crop my picture", "My Window", &crop, 239);

the Track bar name that it is created in "My Window" looks like this:
"Crop n...re"

How can i do to show the complete name?

Thanks

ssr
  • 53
  • 1
  • 4
  • 2
    OpenCV Highui module is intended for debugging purposes only. If you need some good looking GUI, you should use a GUI library (e.g. Qt). It's pointless to make Highgui stuff looking good. – Miki Oct 04 '16 at 08:32
  • 4
    Thanks for the answer I thought that being able to show a three words name did not fall into good looking GUI, :-) Any other idea anyone? – ssr Oct 04 '16 at 10:44

2 Answers2

1

It looks like the window that you've created your trackbar on is too small, especially if you're showing a small Mat object on that window.

Create a new window:

namedWindow("My_Window",WINDOW_AUTOSIZE);

This way, you'll be able to maximize it

Saransh Kejriwal
  • 2,467
  • 5
  • 15
  • 39
  • 2
    The length of the trackbar text does not change, so i can still only see "Crop n...re" – ssr Oct 04 '16 at 17:29
0

You can use \n to insert a line break. It helps a little, but not too much, as you can see in the example below: the third label was set to "gamma\nconstant".

screenshot of opencv GUI element - trackbar label

(Note: I'm using opencv 3.4.2 in python 3.6.)

Gustavo Kaneto
  • 643
  • 7
  • 17