std::string ExportDbDlg::processImage(const wxImage & image) const
{
    wxMemoryOutputStream memStream;
    image.SaveFile(memStream, _("image/jpeg"));
    std::vector<char> buffer(memStream.GetLength());
    memStream.CopyTo(&buffer.at(0), memStream.GetLength());
    std::string stringBuf;
    std::copy(buffer.begin(),
              buffer.end(),
              std::back_inserter(stringBuf));
    return stringBuf;
}
Exemple #2
0
/*static*/ void
wxMemoryFSHandler::AddFile(const wxString& filename,
                           const wxImage& image,
                           wxBitmapType type)
{
    if ( !CheckDoesntExist(filename) )
        return;

    wxMemoryOutputStream mems;
    if ( image.Ok() && image.SaveFile(mems, type) )
    {
        m_Hash[filename] = new wxMemoryFSFile
                               (
                                    mems,
                                    wxImage::FindHandler(type)->GetMimeType()
                               );
    }
    else
    {
        wxLogError(_("Failed to store image '%s' to memory VFS!"), filename);
    }
}
void reProjectAssets::SetAssetIcon(const wxImage& image, rAssetType assetType, const wxString& name) {
	wxString iconPath = GetAssetIconPath(assetType, name);
	image.SaveFile(iconPath, wxBITMAP_TYPE_PNG);
}