Ejemplo n.º 1
0
static bool LoadThumbnail(DisplayState& ds)
{
    if (ds.thumbnail)
        delete ds.thumbnail;
    ds.thumbnail = NULL;

    ScopedMem<WCHAR> bmpPath(GetThumbnailPath(ds.filePath));
    if (!bmpPath)
        return false;

    ds.thumbnail = LoadRenderedBitmap(bmpPath);
    return ds.thumbnail != NULL;
}
Ejemplo n.º 2
0
bool LoadThumbnail(DisplayState& ds) {
    delete ds.thumbnail;
    ds.thumbnail = nullptr;

    AutoFreeW bmpPath(GetThumbnailPath(ds.filePath));
    if (!bmpPath) {
        return false;
    }

    RenderedBitmap* bmp = LoadRenderedBitmap(bmpPath);
    if (!bmp || bmp->Size().IsEmpty()) {
        delete bmp;
        return false;
    }

    ds.thumbnail = bmp;
    return true;
}