Home » U++ Library support » U++ Library : Other (not classified elsewhere) » ImageCtrl issue
ImageCtrl issue [message #15629] |
Thu, 01 May 2008 21:24 |
|
I am having a problem with ImageCtrl:
1) The size of the ImageCtrl is smaller than the image displayed, in MSC8 debug mode.
For example, to display a 256x256 image, I have to set the ImageCtrl rect, in the layout designer, to 228x224.
The control works fine in MSC8 Optimal mode.
a3e77f341aa1d91d0388a0c8b786e8b5
[Updated on: Thu, 01 May 2008 21:26] Report message to a moderator
|
|
|
|
Re: ImageCtrl issue [message #15761 is a reply to message #15759] |
Wed, 07 May 2008 11:12 |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
luzr wrote on Wed, 07 May 2008 09:49 |
cdoty wrote on Thu, 01 May 2008 15:24 | I am having a problem with ImageCtrl:
1) The size of the ImageCtrl is smaller than the image displayed, in MSC8 debug mode.
For example, to display a 256x256 image, I have to set the ImageCtrl rect, in the layout designer, to 228x224.
The control works fine in MSC8 Optimal mode.
|
Units in layout are not exactly pixels; they get "zoomed" according to the actual default system font used (which makes sense, if you think about it
Mirek
|
I had the same problem when I was first using Upp. You have two solutions available (both at run-time, you have no way of accurately setting the size at design-time):
1- Resize the control
Rect r = imagectrl.GetRect();
r.SetSize(image.GetSize());
imagectrl.SetRect(r);
2- Rescale the image to fit the ctrl
imagectrl.SetImage(Rescale(image, imagectrl.GetSize()));
James
|
|
|
|
Re: ImageCtrl issue [message #15782 is a reply to message #15761] |
Wed, 07 May 2008 22:12 |
|
mrjt wrote on Wed, 07 May 2008 04:12 | I had the same problem when I was first using Upp. You have two solutions available (both at run-time, you have no way of accurately setting the size at design-time):
|
Thanks for the help. I went with #1, since I need the image to be a specific size.
a3e77f341aa1d91d0388a0c8b786e8b5
|
|
|
Goto Forum:
Current Time: Fri Mar 29 12:25:31 CET 2024
Total time taken to generate the page: 0.01306 seconds
|