Click here to Skip to main content
16,011,868 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CPP question Pin
Joaquín M López Muñoz30-Jan-02 21:37
Joaquín M López Muñoz30-Jan-02 21:37 
GeneralRe: CPP question Pin
alex.barylski31-Jan-02 12:53
alex.barylski31-Jan-02 12:53 
GeneralRe: CPP question Pin
Joaquín M López Muñoz31-Jan-02 20:12
Joaquín M López Muñoz31-Jan-02 20:12 
GeneralRe: CPP question Pin
Jens Kreiensiek30-Jan-02 21:23
Jens Kreiensiek30-Jan-02 21:23 
GeneralRe: CPP question Pin
alex.barylski31-Jan-02 10:10
alex.barylski31-Jan-02 10:10 
GeneralSetWindowLong and SetWindowHookEx Pin
30-Jan-02 16:36
suss30-Jan-02 16:36 
GeneralRe: SetWindowLong and SetWindowHookEx Pin
30-Jan-02 17:51
suss30-Jan-02 17:51 
QuestionUnit and Unit Conversion for IPicture related stuff ? Pin
30-Jan-02 16:27
suss30-Jan-02 16:27 
Hi, everybody,

This may be a stupid question, but I really hope somebody to help me...
I got some trouble about the "unit" and "unit conversion" for rendering an image.

I have read some people's share codes on this web site. Those codes are all for image rendering with the COM interface IPicture. Here are my questions.

1. IPicture::get_Width: Returns the current width of the picture in the picture object. (from MSDN), the API is as follows:

HRESULT get_Width( OLE_XSIZE_HIMETRIC* pwidth //Receives a pointer to width );

My question is, what kind of unit we get from pwidth ? I mean, is pwidth in inch ? or in mini-meter ? or anything else ? Does this IPicture use MM_HIMETRIC coordinate system ?

2. If there are some code segment related to calculate the dimension (in pixels) of an image,

HIMETRIC_INCH is 2540

long hmWidth;
long hmHeight;
m_pPicture->get_Width(&hmWidth); /// m_pPicture is of type pointer to ///IPicture

m_pPicture->get_Height(&hmHeight);

rcResult.cx = MulDiv(hmWidth, pDC->GetDeviceCaps(LOGPIXELSX), HIMETRIC_INCH);
rcResult.cy = MulDiv(hmHeight, pDC->GetDeviceCaps(LOGPIXELSY), HIMETRIC_INCH);

Could anybody explain why HIMETRIC_INCH (2540) is used above ? And explain more about the above formula ? Is hmWidth (or hmHeight) in mini-meter ?

Thanks in advance ! Any reponse will be appreciated !

GeneralRe: C2501 Pin
Jon Sagara30-Jan-02 16:06
Jon Sagara30-Jan-02 16:06 
GeneralRe: C2501 Pin
Nish Nishant30-Jan-02 18:33
sitebuilderNish Nishant30-Jan-02 18:33 
GeneralRe: C2501 Pin
Jon Sagara30-Jan-02 18:44
Jon Sagara30-Jan-02 18:44 
Generalexception-declaration Pin
alex.barylski30-Jan-02 15:44
alex.barylski30-Jan-02 15:44 
GeneralCustom Control and ON_NOTIFY Pin
XP30-Jan-02 15:41
XP30-Jan-02 15:41 
GeneralRe: Custom Control and ON_NOTIFY Pin
XP30-Jan-02 16:11
XP30-Jan-02 16:11 
GeneralMemory Mapped File Pin
30-Jan-02 14:31
suss30-Jan-02 14:31 
Generalgenerating error messages Pin
Cnoob30-Jan-02 14:11
Cnoob30-Jan-02 14:11 
QuestionHow I know CD-ROM's door is Opened or Closed? Pin
Love In Snowing30-Jan-02 13:57
Love In Snowing30-Jan-02 13:57 
AnswerRe: How I know CD-ROM's door is Opened or Closed? Pin
Jens Kreiensiek30-Jan-02 21:32
Jens Kreiensiek30-Jan-02 21:32 
GeneralRe: How I know CD-ROM's door is Opened or Closed? Pin
Love In Snowing30-Jan-02 21:42
Love In Snowing30-Jan-02 21:42 
GeneralRe: How I know CD-ROM's door is Opened or Closed? Pin
Jens Kreiensiek30-Jan-02 21:53
Jens Kreiensiek30-Jan-02 21:53 
AnswerRe: How I know CD-ROM's door is Opened or Closed? Pin
HintiFlo30-Jan-02 21:39
HintiFlo30-Jan-02 21:39 
GeneralUNICODE reg/ini Pin
Matt Newman30-Jan-02 13:25
Matt Newman30-Jan-02 13:25 
GeneralPlugin Architecture Pin
tdhdeep30-Jan-02 11:39
tdhdeep30-Jan-02 11:39 
GeneralRe: Plugin Architecture Pin
Roger Allen31-Jan-02 1:46
Roger Allen31-Jan-02 1:46 
QuestionFirst Chance Exceptions??? Pin
CSharpDavid30-Jan-02 11:36
CSharpDavid30-Jan-02 11:36 

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.