X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditor.cpp;h=8881a2a3c4835d55358dd3ca01c28dd5ef1f6570;hb=da98f1ad6ed83618c96826a1098f51fbcf0daea3;hp=0ce77e1f959f8359ecd2b16930e199d1cd21bf58;hpb=9d218d1a9ec4512d8b4edad402b2159cfc442ae0;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditor.cpp b/source/contacteditor/frmContactEditor.cpp index 0ce77e1..8881a2a 100644 --- a/source/contacteditor/frmContactEditor.cpp +++ b/source/contacteditor/frmContactEditor.cpp @@ -3113,22 +3113,48 @@ void frmContactEditor::LoadPicture( wxListEvent& event ) std::string base64dec; std::map::iterator initier; + std::map::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 if (pictypeiter->second == wxT("image/gif")){ + + if (!photo.LoadFile(istream, wxBITMAP_TYPE_GIF)){ + + return; + + } + + } else { + + return; + } PictureImage = (wxBitmap)photo; imgPicture->SetBitmap(PictureImage); @@ -6621,6 +6647,8 @@ bool frmContactEditor::GetSelectedItem(wxListCtrl *ListCtrlPtr, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); + *intSelectedData = (int)ListCtrlPtr->GetItemData(*longSelected); + if (*longSelected == -1){ return FALSE; }