473,399 Members | 3,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Activex resizing ?

Hello,

I wrote an ActiveX in MFC. I use it in a C# application (forms).

My computer has a screen resolution of 1280x1024 with 96PPP (Important !!)

I insert my activex in a form, I compile and run all is ok !!

But now I want to use my application in an other computer with screen
resolution of 1280x1024 but with 120 PPP.

The size of my activeX is not correct !! External size is biggest than what
I design!

I suppose it's a problem of physical and logical size, but i d'ont know how
to be independant of the ppp value.

I want to design my form on any computer and obtain the same look on an
other, I suppose it's not a dream ?

Can you help me please ?
Nov 16 '05 #1
2 2646
Mr. Letoffet,
I am curious as to why you have your other computer at 120 dpi? As far as I
have tested, 120 dpi makes lots of Windows apps look bad :-)

But to get to your question, yes the size is not going to be correct. The
only way I can suggest for you to fix this is to modify the drawing code
within your ActiveX object so that it detects the DPI of a system and
adjusts accordingly.

This should be easy to do in GDI if I am not mistaken (if that is what you
are using).

I am going to point you to the following article. Let me know if it helps!

http://msdn.microsoft.com/library/de...highdpiapp.asp

Take care.

--
Nathan

"lionel letoffet" <le******@club-internet.fr> wrote in message
news:42***********************@news.club-internet.fr...
Hello,

I wrote an ActiveX in MFC. I use it in a C# application (forms).

My computer has a screen resolution of 1280x1024 with 96PPP (Important !!)

I insert my activex in a form, I compile and run all is ok !!

But now I want to use my application in an other computer with screen
resolution of 1280x1024 but with 120 PPP.

The size of my activeX is not correct !! External size is biggest than
what
I design!

I suppose it's a problem of physical and logical size, but i d'ont know
how
to be independant of the ppp value.

I want to design my form on any computer and obtain the same look on an
other, I suppose it's not a dream ?

Can you help me please ?

Nov 16 '05 #2
Thank you for your article, it helps me a lot !

I used ColeControl::GetRectInContainer(&rc) and
ColeControl::SetRectInContainer(&rc) to scale my ActiveX.

To calculate the scale factor I save, in a hidden propertie, the dpi value
at design and compute it with the current runtime value.

My current problem is that in the OnCreate function GetRectInContainer and
SetRectInContainer are not correct. So I put the scale correction in
OnDraw with a boolean to do it just one time. But I think it's not a good
place to do this. May be you know a function or a message between
WM_CREATE and WM_PAINT?

A funny effect is if my design dpi is lower than runtime dpi (96 and 120 for
example), I need to do the correction.
But if it is higgest no !
An ActiveX designed and sized at 120 dpi looks good at 96. I can't explain
it yet, and you?

For your question: Why I want to use 120 dpi? I just could say: because...

I don't know settings of the user of my application, but I know that my
application must look good on its computer ! That's all.

In your article the author says tomorrow ;-) the screen will be in 200 dpi,
I have no time to design everyday my software.

An other tips: if you want to do this in C# and forms don't forget to set
the AutoScale propertie of your form to false!

Thank you very much for your help!

Bye.

"Nathan Neitzke" <ne******@erau.edu> a écrit dans le message de
news:%2***************@TK2MSFTNGP12.phx.gbl...
Mr. Letoffet,
I am curious as to why you have your other computer at 120 dpi? As far as I have tested, 120 dpi makes lots of Windows apps look bad :-)

But to get to your question, yes the size is not going to be correct. The
only way I can suggest for you to fix this is to modify the drawing code
within your ActiveX object so that it detects the DPI of a system and
adjusts accordingly.

This should be easy to do in GDI if I am not mistaken (if that is what you
are using).

I am going to point you to the following article. Let me know if it helps!
http://msdn.microsoft.com/library/de...highdpiapp.asp
Take care.

--
Nathan

"lionel letoffet" <le******@club-internet.fr> wrote in message
news:42***********************@news.club-internet.fr...
Hello,

I wrote an ActiveX in MFC. I use it in a C# application (forms).

My computer has a screen resolution of 1280x1024 with 96PPP (Important !!)
I insert my activex in a form, I compile and run all is ok !!

But now I want to use my application in an other computer with screen
resolution of 1280x1024 but with 120 PPP.

The size of my activeX is not correct !! External size is biggest than
what
I design!

I suppose it's a problem of physical and logical size, but i d'ont know
how
to be independant of the ppp value.

I want to design my form on any computer and obtain the same look on an
other, I suppose it's not a dream ?

Can you help me please ?


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: riki | last post by:
Hi, i have a big problem...i'm using one jscript for resizing of all of my pics in popUp...in main html i'm having many little pics and clicking on them they open in popUp and resize to larger...
0
by: TJ Talluto | last post by:
<facts> I have a "month calendar" that always displays exactly 42 days... and alongside is a vertical box that displays the detail (form fields) of any particular select event that appears on the...
5
by: Jim | last post by:
I've heard that resizing images through PHP (either GD2 or ImageMagick) is a processor intensive exercise. I'm setting up a site where users will be uploading up to 10 images along with the details...
12
by: Søren Reinke | last post by:
Hi there I have a little problem. How do i make sure that a graph is not redrawn while the form with the graph is being resized ? I have tried to add a mouse up/down event handler on the...
11
by: Sharon | last post by:
I'm writing a new control derived from UserControl. I need to get an event when the control is done resizing. I tried the Resize, SizeChanged, Move and the Layout events and I also tried to...
2
by: Czort | last post by:
I'm looking for a good ActiveX component for picture resizing (gif, jpg, png) from asp script. It should be able to load an image from stream (f.e. from recordset, binary data source etc.). For...
6
by: hufaunder | last post by:
I have an ActiveX component that I want to use in a library that I am writing. As a first test I used the ActiveX component in a windows form application. Adding the component created: Ax.dll...
9
by: dli07 | last post by:
Hello, I'm trying to convert a piece of code that creates a dynamic vertical resizing bar in a table from internet explorer to firefox. It's based on a post from...
10
by: mishrarajesh44 | last post by:
hii all, I am facing a problem currently.. i have a script for image uploading and resizing.. the image uploading takes place properly for every size images.. but, the resizing works for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.