std::string base64dec;
std::map<int,std::string>::iterator initier;
+ std::map<int,wxString>::iterator pictypeiter;
initier = PicturesList.find(intSelectedData);
+ pictypeiter = PicturesListPictureType.find(intSelectedData);
base64dec = base64_decode(initier->second);
-
wxMemoryInputStream istream(base64dec.c_str(), (size_t)base64dec.size());
wxImage photo;
//wxMemoryInputStream istream(base64dec, (size_t)base64dec.size());
- if (!photo.LoadFile(istream, wxBITMAP_TYPE_ANY)){
+ wxPuts(wxT("PicType:") + pictypeiter->second);
+
+ if (pictypeiter->second == wxT("image/jpeg")){
- return;
+ if (!photo.LoadFile(istream, wxBITMAP_TYPE_JPEG)){
- }
+ return;
+
+ }
+
+ } else if (pictypeiter->second == wxT("image/png")){
+
+ if (!photo.LoadFile(istream, wxBITMAP_TYPE_PNG)){
+
+ return;
+
+ }
+
+ } else {
+
+ return;
+ }
PictureImage = (wxBitmap)photo;
imgPicture->SetBitmap(PictureImage);