PC Review


Reply
Thread Tools Rate Thread

Activex resizing ?

 
 
lionel letoffet
Guest
Posts: n/a
 
      14th Mar 2005
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 ?


 
Reply With Quote
 
 
 
 
Nathan Neitzke
Guest
Posts: n/a
 
      14th Mar 2005
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" <(E-Mail Removed)> wrote in message
news:423601e0$0$15287$(E-Mail Removed)...
> 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 ?
>
>



 
Reply With Quote
 
lionel letoffet
Guest
Posts: n/a
 
      17th Mar 2005
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" <(E-Mail Removed)> a écrit dans le message de
news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:423601e0$0$15287$(E-Mail Removed)...
> > 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 ?
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Resizing ActiveX check box Ziggy Microsoft Excel Worksheet Functions 0 21st Jul 2010 07:05 PM
Resizing an activex checkbox control Blue Max Microsoft Excel Worksheet Functions 2 13th Dec 2008 10:29 PM
Powerpoint crashes when resizing activeX cotrol mitesh303 Microsoft Powerpoint 0 3rd Jul 2007 06:05 AM
ActiveX component for picture resizing Czort Microsoft ASP .NET 2 6th Oct 2004 12:49 PM
ActiveX checkbox resizing Andrew Bell Microsoft Word Document Management 8 14th Apr 2004 02:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:17 PM.