Click here to Skip to main content
15,904,287 members
Home / Discussions / C#
   

C#

 
GeneralRe: Downloading a file... Pin
Mark Salsbery9-Nov-08 10:02
Mark Salsbery9-Nov-08 10:02 
GeneralRe: Downloading a file... Pin
Christian Graus9-Nov-08 10:06
protectorChristian Graus9-Nov-08 10:06 
GeneralRe: Downloading a file... Pin
EliottA9-Nov-08 10:24
EliottA9-Nov-08 10:24 
GeneralRe: Downloading a file... Pin
EliottA9-Nov-08 10:27
EliottA9-Nov-08 10:27 
QuestionWorld coordinates? Pin
seafaror9-Nov-08 7:31
seafaror9-Nov-08 7:31 
GeneralRe: World coordinates? Pin
Luc Pattyn9-Nov-08 7:59
sitebuilderLuc Pattyn9-Nov-08 7:59 
GeneralRe: World coordinates? Pin
seafaror9-Nov-08 9:43
seafaror9-Nov-08 9:43 
QuestionCannot change Graphics.PageScale on Graphics object created via Control.CreateGraphics() Pin
pulsar19609-Nov-08 7:12
pulsar19609-Nov-08 7:12 
Hello,

I have an application that reads XML files containing coordinates of text and graphics objects (lines, arrows, etc...). The coordinates are in units equal to (font height) / 8. In my override of Control.OnPaint(), I include a line like this to change the PageScale property of the Graphics object passed in to the function.

float font_height = Font.GetHeight(e.Graphics);
e.Graphics.PageScale = font_height / 8;

This works as expected in that Graphics.PageScale is set to approximately 2.8 and all of the calls to the drawing and text ends up at the coordinates read from the XML files multiplied by 2.8.

The problem is in my override of OnMouseMove. I need to change the color of these lines and text as the user passes the mouse over them. Since there is not a Graphics object passed into OnMouseMove I create one using Control.CreateGraphics(). The problem is that even though I change the PageScale property to the same value as in OnPaint, the drawing functions do not recognize the new scaling factor. In the debugger I can see that the value of PageScale has been successfully changed.

Has anyone run into this problem or am I doing something wrong?

Thanks.
AnswerRe: Cannot change Graphics.PageScale on Graphics object created via Control.CreateGraphics() Pin
Christian Graus9-Nov-08 7:32
protectorChristian Graus9-Nov-08 7:32 
QuestionDll Callback and shared memory [modified] Pin
Paolo Vernazza9-Nov-08 6:33
Paolo Vernazza9-Nov-08 6:33 
AnswerRe: Dll Callback and shared memory Pin
Mark Salsbery9-Nov-08 7:17
Mark Salsbery9-Nov-08 7:17 
GeneralRe: Dll Callback and shared memory Pin
Paolo Vernazza9-Nov-08 8:25
Paolo Vernazza9-Nov-08 8:25 
GeneralRe: Dll Callback and shared memory Pin
Mark Salsbery9-Nov-08 8:34
Mark Salsbery9-Nov-08 8:34 
GeneralRe: Dll Callback and shared memory Pin
Paolo Vernazza10-Nov-08 5:21
Paolo Vernazza10-Nov-08 5:21 
Questionhow to send text to external program Pin
E_Gold9-Nov-08 2:36
E_Gold9-Nov-08 2:36 
AnswerRe: how to send text to external program Pin
Giorgi Dalakishvili9-Nov-08 3:09
mentorGiorgi Dalakishvili9-Nov-08 3:09 
GeneralRe: how to send text to external program Pin
E_Gold9-Nov-08 3:39
E_Gold9-Nov-08 3:39 
GeneralRe: how to send text to external program Pin
Giorgi Dalakishvili9-Nov-08 4:55
mentorGiorgi Dalakishvili9-Nov-08 4:55 
AnswerRe: how to send text to external program Pin
sph3rex9-Nov-08 6:31
sph3rex9-Nov-08 6:31 
GeneralRe: how to send text to external program Pin
jas0n2311-Nov-08 0:41
jas0n2311-Nov-08 0:41 
QuestionRun an application? Pin
dec829-Nov-08 1:49
dec829-Nov-08 1:49 
AnswerRe: Run an application? Pin
Guffa9-Nov-08 3:26
Guffa9-Nov-08 3:26 
GeneralRe: Run an application? Pin
dec829-Nov-08 5:21
dec829-Nov-08 5:21 
GeneralRe: Run an application? Pin
Guffa9-Nov-08 6:40
Guffa9-Nov-08 6:40 
QuestionHow to find parent's child in matrix (in maze)? Pin
sitnet9-Nov-08 1:25
sitnet9-Nov-08 1:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.