Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Tue, 19 Feb 2008 05:28:00 -0800,    group: microsoft.public.platformsdk.gdi        back       


zoom in, out text and window   
Hi,

I have a problem to draw a text within its window (in fact it is an own edit 
box).
The window is on a view what user can zoom in and out.
To magnify or reduce objects size I use SetViewportExt() of CDC of the view.
This code was used to magnify or reduce (overlayed) objects of an image.

  pDrawDC->SetMapMode(MM_ANISOTROPIC);
  pDrawDC->SetWindowExt(10000, 10000);
  int nViewExt = int(10000 * GetZoom());
  pDrawDC->SetViewportExt(nViewExt, nViewExt);

If I fill the box with text fully, at size of 100% and change zoom to 75% 
(GetZoom() function) the text do not fill or out of window (truncated) (in 
case of 50%).
It is not some pixel but 2 - 4 character! (full text ~ 30 char)
The window size is good as I see, but the length of text changing in case of 
other zoom factor than the original.

Font properties do not changed : 

m_logFont.lfHeight = -29
m_logFont.lfWight = 400
m_logFont.lfCharSet = 1
m_logFont.lfPitchAndFamily = 32
m_logFont.lfFaceName = empty ''
other are zero

Create of the font what was selected : actFont.CreateFontIndirect(&m_logFont);

I mean the problem with drawing of text and font.
It manage : pDC->DrawText(csCaption, &rcText, m_nTextAlignment | 
DT_WORDBREAK | DT_NOPREFIX);.
What can I do for text remaining beside the window?

Thank you for any idea,
Imre
date: Tue, 19 Feb 2008 05:28:00 -0800   author:   Imre Ament

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us