用IPicture读图画,用他的get_Width(),get_Height()想得到图片的宽高,但得到的值不正确,究竟应该用什么函数??

解决方案 »

  1.   

    OLE_XSIZE_HIMETRIC:VTS_XSIZE_HIMETRIC   A 32-bit unsigned integer used to represent the width of a screen object in HIMETRIC units
      

  2.   

    不对吧,
        OLE_XSIZE_HIMETRIC hmWidth;
        OLE_XSIZE_HIMETRIC hmHeight;
        m_IPic->get_Width( &hmWidth )/25;
        m_IPic->get_Height( &hmHeight )/25;结果不准啊
      

  3.   

    m_pPicture->get_Width(&m_hmWidth);
    m_pPicture->get_Height(&m_hmHeight);// convert himetric to pixels#define HIMETRIC_INCH 2540HDC hdc=GetDC(NULL);int nWidth = MulDiv(m_hmWidth, GetDeviceCaps(hdc, LOGPIXELSX), HIMETRIC_INCH);
    int nHeight = MulDiv(m_hmHeight, GetDeviceCaps(hdc, LOGPIXELSY), HIMETRIC_INCH);//Relest DC
    ReleaseDC(NULL,hdc);