Home » U++ Library support » U++ Widgets - General questions or Mixed problems » How to resize an ImageCtrl to fit the Image?
Re: How to resize an ImageCtrl to fit the Image? [message #5695 is a reply to message #5691] |
Tue, 10 October 2006 12:41   |
James Thomas
Messages: 26 Registered: June 2006
|
Promising Member |
|
|
Ah ha! I don't think I'd quite understood how logical positions worked. LogC members a & b are similar to position and size but relative to the anchor, except when SizePos is used, correct?
Basically the code I was looking for is this:
Size sz = ctrl.AddFrameSize(img->GetSize());
// Resize ctrl
Ctrl::LogPos p = ctrl.GetPos();
p.x.SetB(sz.cx);
p.y.SetB(sz.cy);
ctrl.SetPos(p);
I realise this won't work for all cases, but it's good enough for now.
I really should have seen this straight away but I haven't written a GUI in anything that does layouts like this before so it took a while for me to clock it. It's always the simple things in U++ that get me stuck.
Thanks for your patience
[Updated on: Tue, 10 October 2006 13:53] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Jun 06 12:16:28 CEST 2025
Total time taken to generate the page: 0.04397 seconds
|