当前位置: 首页>>代码示例>>C++>>正文


C++ OSGraphics::drawBitmap方法代码示例

本文整理汇总了C++中OSGraphics::drawBitmap方法的典型用法代码示例。如果您正苦于以下问题:C++ OSGraphics::drawBitmap方法的具体用法?C++ OSGraphics::drawBitmap怎么用?C++ OSGraphics::drawBitmap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OSGraphics的用法示例。


在下文中一共展示了OSGraphics::drawBitmap方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: draw

void CtrlSliderBg::draw( OSGraphics &rImage, int xDest, int yDest )
{
    if( m_pImgSeq )
    {
        if( m_bgWidth > 0 && m_bgHeight > 0 )
        {
            // Compute the resize factors
            float factorX, factorY;
            getResizeFactors( factorX, factorY );

            // Rescale the image with the actual size of the control
            ScaledBitmap bmp( getIntf(), *m_pImgSeq,
                 m_bgWidth * m_nbHoriz - (int)(m_padHoriz * factorX),
                 m_bgHeight * m_nbVert - (int)(m_padVert * factorY) );

            // Locate the right image in the background bitmap
            int x = m_bgWidth * ( m_position % m_nbHoriz );
            int y = m_bgHeight * ( m_position / m_nbHoriz );
            // Draw the background image
            rImage.drawBitmap( bmp, x, y, xDest, yDest,
                               m_bgWidth - (int)(m_padHoriz * factorX),
                               m_bgHeight - (int)(m_padVert * factorY) );
        }
    }
}
开发者ID:FLYKingdom,项目名称:vlc,代码行数:25,代码来源:ctrl_slider.cpp

示例2: draw

void AnimBitmap::draw( OSGraphics &rImage, int xDest, int yDest )
{
    // Draw the current frame
    int height = m_pImage->getHeight() / m_nbFrames;
    int ySrc = height * m_curFrame;

    // The old way .... transparency was not taken care of
    // rImage.drawGraphics( *m_pImage, 0, ySrc, xDest, yDest,
    //                      m_pImage->getWidth(), height );

    // A new way .... needs to be tested thoroughly
    rImage.drawBitmap( m_rBitmap, 0, ySrc, xDest, yDest,
                       m_pImage->getWidth(), height, true );
}
开发者ID:FLYKingdom,项目名称:vlc,代码行数:14,代码来源:anim_bitmap.cpp

示例3: draw

void AnimBitmap::draw( OSGraphics &rImage, int xDest, int yDest, int w, int h,
                       int xOffset, int yOffset )
{
    // Draw the current frame
    int height = m_pImage->getHeight() / m_nbFrames;
    int ySrc = height * m_curFrame;

    // The old way .... transparency was not taken care of
    // rImage.drawGraphics( *m_pImage, 0, ySrc, xDest, yDest,
    //                      m_pImage->getWidth(), height );

    rImage.drawBitmap( m_rBitmap,
                       xOffset, ySrc + yOffset,
                       xDest, yDest, w, h, true );
}
开发者ID:BloodExecutioner,项目名称:vlc,代码行数:15,代码来源:anim_bitmap.cpp

示例4: draw

void CtrlText::draw( OSGraphics &rImage, int xDest, int yDest, int w, int h )
{
    rect clip( xDest, yDest, w, h );
    const Position *pPos = getPosition();
    if( m_pCurrImg )
    {
        // Compute the dimensions to draw
        int width = min( m_pCurrImg->getWidth() + m_xPos,
                         getPosition()->getWidth() );
        int height = min( m_pCurrImg->getHeight(), getPosition()->getHeight() );
        // Draw the current image
        if( width > 0 && height > 0 )
        {
            int offset = 0;
            if( m_alignment == kLeft )
            {
                // We align to the left
                offset = 0;
            }
            else if( m_alignment == kRight &&
                     width < getPosition()->getWidth() )

            {
                // The text is shorter than the width of the control, so we
                // can align it to the right
                offset = getPosition()->getWidth() - width;
            }
            else if( m_alignment == kCenter &&
                     width < getPosition()->getWidth() )
            {
                // The text is shorter than the width of the control, so we
                // can center it
                offset = (getPosition()->getWidth() - width) / 2;
            }
            rect region( pPos->getLeft() + offset,
                         pPos->getTop(), width, height );
            rect inter;
            if( rect::intersect( region, clip, &inter ) )
                rImage.drawBitmap( *m_pCurrImg, -m_xPos + inter.x - region.x,
                                   inter.y - region.y,
                                   inter.x, inter.y,
                                   inter.width, inter.height, true );
        }
    }
}
开发者ID:vlcchina,项目名称:vlc-player-experimental,代码行数:45,代码来源:ctrl_text.cpp

示例5: draw

void CtrlText::draw( OSGraphics &rImage, int xDest, int yDest )
{
    if( m_pCurrImg )
    {
        // Compute the dimensions to draw
        int width = min( m_pCurrImg->getWidth() + m_xPos,
                         getPosition()->getWidth() );
        int height = min( m_pCurrImg->getHeight(), getPosition()->getHeight() );
        // Draw the current image
        if( width > 0 && height > 0 )
        {
            int offset = 0;
            if( m_alignment == kLeft )
            {
                // We align to the left
                offset = 0;
            }
            else if( m_alignment == kRight &&
                     width < getPosition()->getWidth() )

            {
                // The text is shorter than the width of the control, so we
                // can align it to the right
                offset = getPosition()->getWidth() - width;
            }
            else if( m_alignment == kCenter &&
                     width < getPosition()->getWidth() )
            {
                    // The text is shorter than the width of the control, so we
                    // can center it
                offset = (getPosition()->getWidth() - width) / 2;
            }
            rImage.drawBitmap( *m_pCurrImg, -m_xPos, 0, xDest + offset,
                               yDest, width, height, true );
        }
    }
}
开发者ID:FLYKingdom,项目名称:vlc,代码行数:37,代码来源:ctrl_text.cpp


注:本文中的OSGraphics::drawBitmap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。