Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » ImageCtrl issue
ImageCtrl issue [message #15629] Thu, 01 May 2008 21:24 Go to next message
cdoty is currently offline  cdoty
Messages: 23
Registered: April 2008
Location: Houston, TX
Promising Member

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 #15759 is a reply to message #15629] Wed, 07 May 2008 10:49 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
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 Wink

Mirek
Re: ImageCtrl issue [message #15761 is a reply to message #15759] Wed, 07 May 2008 11:12 Go to previous messageGo to next message
mrjt is currently offline  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 Wink

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 #15762 is a reply to message #15761] Wed, 07 May 2008 11:58 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, also, if you insist on "pixel perfect" layouts, you can also disable font zooming by Ctrl::NoFontZoom.

Mirek
Re: ImageCtrl issue [message #15782 is a reply to message #15761] Wed, 07 May 2008 22:12 Go to previous message
cdoty is currently offline  cdoty
Messages: 23
Registered: April 2008
Location: Houston, TX
Promising Member

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
Previous Topic: Using StartProcess with ping
Next Topic: Display problem with Splitter, GLCtrl and MenuBar
Goto Forum:
  


Current Time: Fri Mar 29 12:25:31 CET 2024

Total time taken to generate the page: 0.01306 seconds