Click here to Skip to main content
15,922,166 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: about adapter Pin
Hamid_RT14-Apr-07 6:36
Hamid_RT14-Apr-07 6:36 
QuestionHow to know whether still connected or not Pin
Kiran Pinjala14-Apr-07 3:19
Kiran Pinjala14-Apr-07 3:19 
AnswerRe: How to know whether still connected or not Pin
Dmitry Khudorozhkov14-Apr-07 7:53
Dmitry Khudorozhkov14-Apr-07 7:53 
Questionclasses in a mfc extended dll, one use another. Pin
eat_union14-Apr-07 2:42
eat_union14-Apr-07 2:42 
QuestionSet point's size Pin
Chen-XuNuo14-Apr-07 1:48
Chen-XuNuo14-Apr-07 1:48 
AnswerRe: Set point's size Pin
Hamid_RT14-Apr-07 6:14
Hamid_RT14-Apr-07 6:14 
QuestionRe: Set point's size Pin
Mark Salsbery14-Apr-07 7:45
Mark Salsbery14-Apr-07 7:45 
AnswerRe: Set point's size Pin
bob1697214-Apr-07 8:30
bob1697214-Apr-07 8:30 
Even though CDC::SetPixel takes a logical coordinate, it does not behave like the other drawing primitives in mapping modes (like MM_ISOTROPIC, MM_ANISOTROPIC, MM_HIMETRIC, etc...) in the sense of having a metrically translated "size". CDC::SetPixel will adapt it's coordinates correctly based upon the viewport and window extents (i.e. it's position will scale correctly relative to other drawing primitives like lines, rectangles, circles, and even text) but it will always remain a tiny little "dot" no matter how far you zoom in while the other drawing primitives and text grow.

If you want a logical "dot" to scale, you will likely need to perform a MoveTo/LineTo with the appropriate start and end coordinates or maybe a filled rectangle with no border with the appropriate size or even some blit pattern all defined appropriately in the logical world. Then as you change the viewport and window extents, you will get the effect you are trying to achieve.

However, use this method sparingly since drawing a "dot" to a device context is horribly expensive if your attempting to draw thousands, tens of thousands, or even millions of them as would be the case if your goal is to manipulate a bitmap or something to that effect. If this happens to be the context your in, consider getting the "bits" from a bitmap and working on those strictly in logical coordinates and later "blit" these to a device context to get the effects of the mapping mode metric translations.

Look up MM_ANISOTROPIC and MM_ISOTROPIC in MSDN as these are the most versatile mapping modes available since they don't lock in the viewport and window extents like MM_HIMETRIC, MM_HIENGLISH, and all the rest do.

I may be reading too much into what you asked but my gut reaction to any question regarding SetPixel/GetPixel is to assume the programmer is trying to manipulate bitmap bits as opposed to rendering drawing primitives. Either way, I hope my response helps somehow.

GeneralRe: Set point's size Pin
John R. Shaw14-Apr-07 15:21
John R. Shaw14-Apr-07 15:21 
GeneralRe: Set point's size Pin
bob1697214-Apr-07 16:19
bob1697214-Apr-07 16:19 
GeneralRe: Set point's size Pin
John R. Shaw14-Apr-07 16:54
John R. Shaw14-Apr-07 16:54 
GeneralRe: Set point's size Pin
Chen-XuNuo14-Apr-07 22:05
Chen-XuNuo14-Apr-07 22:05 
GeneralRe: Set point's size Pin
Mark Salsbery15-Apr-07 14:02
Mark Salsbery15-Apr-07 14:02 
QuestionRegarding Error, Please help. Pin
dhavalshah12314-Apr-07 1:00
dhavalshah12314-Apr-07 1:00 
AnswerRe: Regarding Error, Please help. Pin
Hamid_RT14-Apr-07 6:24
Hamid_RT14-Apr-07 6:24 
GeneralRe: Regarding Error, Please help. Pin
Nikhil Trivedi16-Apr-07 0:03
Nikhil Trivedi16-Apr-07 0:03 
GeneralRe: Regarding Error, Please help. Pin
Hamid_RT16-Apr-07 0:45
Hamid_RT16-Apr-07 0:45 
AnswerRe: Regarding Error, Please help. Pin
John R. Shaw14-Apr-07 15:32
John R. Shaw14-Apr-07 15:32 
AnswerRe: Regarding Error, Please help. Pin
Michael Dunn14-Apr-07 21:40
sitebuilderMichael Dunn14-Apr-07 21:40 
Questionto define callback function Pin
zon_cpp14-Apr-07 0:18
zon_cpp14-Apr-07 0:18 
AnswerRe: to define callback function Pin
John R. Shaw14-Apr-07 15:41
John R. Shaw14-Apr-07 15:41 
GeneralRe: to define callback function Pin
zon_cpp14-Apr-07 20:54
zon_cpp14-Apr-07 20:54 
QuestionX.25 Protocol Pin
B. A. Gupta13-Apr-07 22:36
B. A. Gupta13-Apr-07 22:36 
AnswerRe: X.25 Protocol Pin
Nirmal S22-Sep-09 2:01
Nirmal S22-Sep-09 2:01 
QuestionAlternative to CImage Pin
QuickDeveloper13-Apr-07 22:33
QuickDeveloper13-Apr-07 22:33 

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.