Re: SetMapMode
- From: "Mike Williams" <mikea@xxxxxxxxxxxxxxxxx>
- Date: Fri, 23 Mar 2007 14:41:43 -0000
"Steve" <sredmyer@xxxxxxxxxx> wrote in message news:1174657236.096210.12000@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
However I do not know what type of window may be passed in
and since what I am writting is an ActiveX component, I can not
even be assured that the passed in window will be a VB window
(might be any window from any enviornment capable of utilizing
ActiveX)
Then you'll just have to do what almost all API functions do and assume that the units which are being passed to them are in units appropriate to the current mapping mode of the DC in question. People who write code which passes coordinates to an API routine to perform some drawing function in a window DC should know what the current mapping mode of that DC is when they decide on the values of the coordinates they want to pass, otherwise they should not be writing code. Almost everyone who writes VB code, for example, uses pixels for the coordinates when calling an API function, regardless of the ScaleMode of the "VB window" they are dealing with. Very few people who write VB code change the mapping mode before making the call to a GDI API, And if they do change the mapping mode they will of course know what the new mapping mode is and they will use the appropriate values for their coordinates. Just have your routine draw its stuff on the assumption that the coordinates which are passed to it are appropriate for the current mapping mode of the DC. That's what most of the API functions do. And if the window handle (or DC or whatever) being passed to your routine is not a VB window then you should assume that the people who wrote the code to call your routine know what they are doing, and know the mapping mode they are using. After all, the Rectangle API (for example) does not say to itself, "I wonder if this DC is a VB DC, and if the person who wrote the code has sent me the coordinates using VB ScaleMode units instead of the current mapping mode units"! The Rectangle API just assumes that the person who called the routine knows what he is doing!
Mike
.
- Follow-Ups:
- Re: SetMapMode
- From: Steve
- Re: SetMapMode
- References:
- SetMapMode
- From: Steve
- Re: SetMapMode
- From: Mike Williams
- Re: SetMapMode
- From: Steve
- Re: SetMapMode
- From: Mike Williams
- Re: SetMapMode
- From: Steve
- SetMapMode
- Prev by Date: Re: vb6 -v- Net!
- Next by Date: Re: Drag & Drop from ListView to TreeView on VB6
- Previous by thread: Re: SetMapMode
- Next by thread: Re: SetMapMode
- Index(es):
Relevant Pages
|
Loading