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


C++ UnRef函数代码示例

本文整理汇总了C++中UnRef函数的典型用法代码示例。如果您正苦于以下问题:C++ UnRef函数的具体用法?C++ UnRef怎么用?C++ UnRef使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: UnRef

bool wxBitmap::CreateFromImage(const wxImage& image, int depth)
{
    UnRef();

    wxCHECK_MSG( image.Ok(), FALSE, wxT("invalid image") )
    wxCHECK_MSG( depth == -1 || depth == 1, FALSE, wxT("invalid bitmap depth") )

    if (image.GetWidth() <= 0 || image.GetHeight() <= 0)
        return false;
    
    m_refData = new wxBitmapRefData();

    if (depth == 1)
    {
        return CreateFromImageAsBitmap(image);
    }
    else
    {
#ifdef __WXGTK20__
        if (image.HasAlpha())
            return CreateFromImageAsPixbuf(image);
#endif
        return CreateFromImageAsPixmap(image);
    }
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:25,代码来源:bitmap.cpp

示例2: UnRef

bool wxPalette::Create( int n,
                        const unsigned char* pRed,
                        const unsigned char* pGreen,
                        const unsigned char* pBlue )
{
    PULONG                          pualTable;

    UnRef();

    m_refData = new wxPaletteRefData;
    pualTable = new ULONG[n];
    if (!pualTable)
        return false;

    for (int i = 0; i < n; i ++)
    {
        pualTable[i] = (PC_RESERVED * 16777216) + ((int)pRed[i] * 65536) + ((int)pGreen[i] * 256) + (int)pBlue[i];
    }
    M_PALETTEDATA->m_hPalette = (WXHPALETTE)::GpiCreatePalette( vHabmain
                                                               ,LCOL_PURECOLOR
                                                               ,LCOLF_CONSECRGB
                                                               ,(LONG)n
                                                               ,pualTable
                                                              );
    delete [] pualTable;
    return true;
} // end of wxPalette::Create
开发者ID:jonntd,项目名称:dynamica,代码行数:27,代码来源:palette.cpp

示例3: wxCHECK_MSG

bool wxPlotFunction::Create( const wxPlotFunction& curve )
{
    wxCHECK_MSG(curve.Ok(), false, wxT("invalid plot function"));
    UnRef();
    Ref(curve);
    return true;
}
开发者ID:mdavis45419,项目名称:osiris,代码行数:7,代码来源:plotfunc.cpp

示例4: UnRef

cLuaState::cRef::~cRef()
{
	if (m_LuaState != nullptr)
	{
		UnRef();
	}
}
开发者ID:1285done,项目名称:cuberite,代码行数:7,代码来源:LuaState.cpp

示例5: WXUNUSED

bool wxAnimation::LoadFile(const wxString &name, wxAnimationType WXUNUSED(type))
{
    UnRef();
    m_pixbuf = gdk_pixbuf_animation_new_from_file(
        wxConvFileName->cWX2MB(name), NULL);
    return IsOk();
}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:7,代码来源:animate.cpp

示例6: UnRef

bool wxBitmap::Create(int width, int height, int depth )
{
    UnRef();
    m_refData = new wxBitmapRefData(width, height, depth);
    
    return true;
}
开发者ID:HanruZhou,项目名称:wxWidgets,代码行数:7,代码来源:bitmap.cpp

示例7: UnRef

bool wxBitmap::LoadFile(const wxString &name, wxBitmapType type)
{
    UnRef();

    wxBitmapHandler *handler = FindHandler(type);

    if ( handler == NULL )
    {
        wxImage image;
        if ( !image.LoadFile(name, type) || !image.IsOk() )
        {
            wxLogError(_("No bitmap handler for type %d defined."), type);
            return false;
        }
        else
        {
            *this = wxBitmap(image);
            return true;
        }
    }

    m_refData = new wxBitmapRefData();

    return handler->LoadFile(this, name, type, -1, -1);
}
开发者ID:beanhome,项目名称:dev,代码行数:25,代码来源:bitmap.cpp

示例8: UnRef

cLuaState::cRef::~cRef()
{
	if (m_LuaState != NULL)
	{
		UnRef();
	}
}
开发者ID:Dam63,项目名称:MCServer,代码行数:7,代码来源:LuaState.cpp

示例9: UnRef

void wxGenericPen::Create(const wxGenericColour &colour, int width, wxPenStyle style,
                          wxPenCap cap, wxPenJoin join )
{
    UnRef();
    m_refData = new wxGenericPenRefData(width, style, cap, join);
    M_GPENDATA->m_colour = colour;
}
开发者ID:DowerChest,项目名称:codeblocks,代码行数:7,代码来源:genergdi.cpp

示例10: UnRef

void wxGenericPen::Create(const wxGenericColour &colour, int width, int style,
                          int cap, int join )
{
    UnRef();
    m_refData = new wxGenericPenRefData(width, style, cap, join);
    M_GPENDATA->m_colour = colour;
}
开发者ID:Jarlene,项目名称:mrpt,代码行数:7,代码来源:genergdi.cpp

示例11: UnRef

void wxAnimation::SetPixbuf(GdkPixbufAnimation* p)
{
    UnRef();
    m_pixbuf = p;
    if (m_pixbuf)
        g_object_ref(m_pixbuf);
}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:7,代码来源:animate.cpp

示例12: wxCHECK_MSG

bool wxOptionValue::Create( const wxOptionValue &optValue )
{
    wxCHECK_MSG( optValue.Ok(), false, wxT("Invalid wxOptionValue") );

    UnRef();
    Ref( optValue );
    return Ok();
}
开发者ID:DowerChest,项目名称:codeblocks,代码行数:8,代码来源:optvalue.cpp

示例13: wxCHECK_MSG

bool wxSheetCellRenderer::Copy(const wxSheetCellRenderer& other)
{
    wxCHECK_MSG(other.Ok(), false, wxT("wxSheetCellRenderer is not created"));

    UnRef();
    m_refData = ((wxSheetCellRendererRefData*)other.m_refData)->Clone();
    return true;
}
开发者ID:stahta01,项目名称:wxCode_components,代码行数:8,代码来源:sheetren.cpp

示例14: UnRef

bool wxFontBase::SetFaceName(const wxString &facename)
{
    if (!wxFontEnumerator::IsValidFacename(facename))
    {
        UnRef();        // make Ok() return false
        return false;
    }

    return true;
}
开发者ID:EdgarTx,项目名称:wx,代码行数:10,代码来源:fontcmn.cpp

示例15: UnRef

void wxColour::InitRGBA(unsigned char red, unsigned char green, unsigned char blue,
                        unsigned char alpha)
{
    UnRef();

    m_refData = new wxColourRefData(
        (guint16(red) << SHIFT) + red,
        (guint16(green) << SHIFT) + green,
        (guint16(blue) << SHIFT) + blue,
        alpha);
}
开发者ID:BloodRedd,项目名称:gamekit,代码行数:11,代码来源:colour.cpp


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