XTK change the height and width of a canvas - xtk

I would know if it possible to change the height and the width of a canvas genarated after the init of a X.render2D of a volume object(.nii.gz)

You can modify the height and width of the container div and then fire a window resize event. XTK catches the event and adjusts the canvas according to the container height and width after that.

Related

How to set min-height on vue-chartjs

I have a chart in vue3 with vue-chart.js
When I view in mobile size the chart is too small to view in height.
How do I assign a min-height in CSS or in chart-options?
I have set the div height to 200px but the chart will still shrink as the width gets reduced.
I can set the chart-options "responsive: false" and the hiegth but the width does not follow changing size. Maybe a responsive in width but set height is the answer but not sure how to do that.
Thanks

Flex Slider full height and width without stretching

I need Flex Slider to occupy the entire page, like the one on this website: http://webfire.co.uk/
I've set both height and width to 100%, but when I re-size the page, it causes the image to distort and stretch. However, setting the height to auto leaves a white space underneath the slider, so it doesn't fill up the full page. The same thing happens with background-size:cover - the width becomes responsive but the height stays the same.
On the website above, they manage to sort of re-center the image when the window is re-sized.
Any suggestions? :)

Set max width of a Gtk::TextView

I've created a textview which is being filled by a Gtk::TextBuffer, however the buffer contains a lot of characters and the window gets wider than the width of the screen.
Is there a way to define a max width for a Gtk::TextView?
Put the text view in a Gtk::ScrolledWindow and set the size request of the scrolled window.

How to force a window to maintain a certain width/height ratio when resized

I want my window to always maintain a certain ratio of let's say 1.33333333. So, if the window is width = 800, height = 600 and the user changes the width to 600, I want to change the height to 450 automatically.
I'm already intercepting WM_SIZE but I don't know if it's enough; also I don't know how to change the width or height to maintain my ratio.
WM_SIZING is sent to the window while the user is resizing the window.
Rather handle WM_WINDOWPOSCHANGING - this is sent by the internal SetWindowPos function when code (or the user) changes the window size and will ensure that even tile & cascade operations obey your sizing policy.
See WM_SIZING: http://msdn.microsoft.com/en-us/library/ms632647.aspx
Processing this message allows you to change resulting window size.
Try the Resize event. There is an example of how to maintain a desired aspect ration in the link.

How to increase a cells height and width in ListControl

How can we increase the the height and width of a cell in List
It is created using Listcontrol MFC
Write a custom list control (owner
drawn).
handle message MEASUREITEM_REFLECT
set the cell height and width in the
method:
MeasureItem( LPMEASUREITEMSTRUCT
lpMeasureItemStruct )
To set the cell width take a look at the ListView_SetColumnWidth Win32 function.
One way to set the height is to attach an image list to the list control. The list control will then set the row height based on the height of the icons in the image list.
An easy way to set the cell height of a list control is by supplying an image list of the required height:
In the header:
CImageList m_imageList;
In the implementation:
m_imageList.Create(68, 68, ILC_COLOR4, 10, 10); // 68 = cell height in pixels
m_list.SetImageList(&m_imageList, LVSIL_SMALL);
Setting the cell width is achieved by simply calling SetColumnWidth (as pointed out by jussij)