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


C++ wxBitmap::GetDirectFBSurface方法代码示例

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


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

示例1: DoDrawSubBitmap

void wxDC::DoDrawSubBitmap(const wxBitmap &bmp,
                           wxCoord x, wxCoord y, wxCoord w, wxCoord h,
                           wxCoord destx, wxCoord desty, int rop, bool useMask)
{
    wxCHECK_RET( Ok(), wxT("invalid dc") );
    wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap") );

    // NB: we could also support XOR here (via DSBLIT_XOR)
    //     and possibly others via SetSrc/DstBlendFunction()
    wxCHECK_RET( rop == wxCOPY, _T("only wxCOPY function supported") );

    if ( bmp.GetDepth() == 1 )
    {
        // Mono bitmaps are handled in special way -- all 1s are drawn in
        // foreground colours, all 0s in background colour.
        wxFAIL_MSG( _T("drawing mono bitmaps not implemented") );
        return;
    }

    if ( useMask && bmp.GetMask() )
    {
        // FIXME_DFB: see MGL sources for a way to do it, but it's not directly
        //            applicable because DirectFB doesn't implement ROPs; OTOH,
        //            it has blitting modes that can be useful; finally, see
        //            DFB's SetSrcBlendFunction() and SetSrcColorKey()
        wxFAIL_MSG( _T("drawing bitmaps with masks not implemented") );
        return;
    }

    DoBlitFromSurface(bmp.GetDirectFBSurface(),
                      x, y,
                      w, h,
                      destx, desty);
}
开发者ID:hgwells,项目名称:tive,代码行数:34,代码来源:dc.cpp

示例2: DoSelect

void wxMemoryDC::DoSelect(const wxBitmap& bitmap)
{
    m_bmp = bitmap;

    if ( !bitmap.Ok() )
    {
        // select the bitmap out of the DC
        m_surface = NULL;
        return;
    }

    // init the DC for drawing to this bitmap
    DFBInit(bitmap.GetDirectFBSurface());
}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:14,代码来源:dcmemory.cpp


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