誰有 c++ builder 根據 OpenDialog得到文件路徑后保存 文件的代碼啊
誰有發來看一下啊 呵呵呵
[解决办法]
PostStream = new TIdMultiPartFormDataStream(); MS = new TMemoryStream(); if (tFORM->PicOpenDialog->ProcessP(SI->PI->FilePath, SI->PI->FileName, NULL, tFORM->Res.ToInt(), BMP, TBMP, JPG, i, -1)) { tFORM->LS->Caption = L"旋转图片"; tFORM->PicOpenDialog->Turn(TBMP, BMP, SI->PI->Turn); tFORM->Image1->CleanupInstance(); //tFORM->Image1->Picture->Graphic = NULL; tFORM->Image1->Picture->Assign(TBMP); tFORM->LS->Caption = L"压缩图片"; JPG->Assign(TBMP); JPG->CompressionQuality = JPG_QUALITY; JPG->Compress(); tFORM->LS->Caption = L"准备上传"; JPG->SaveToStream(MS); MS->Seek(0,soFromBeginning); //这里加入大小检测,在没有gif之前可以不做 PostStream->AddFormField(L"AlbumID", tFORM->Aid); PostStream->AddObject(L"UpName", L"image/JPEG", MS, SI->PI->FileName + L".jpg"); //tFORM->IdHTTP1->CleanupInstance(); try { Result = tFORM->IdHTTP1->Post(UPLOAD_PAGE, PostStream); //需要加检测 } catch(Exception &e) { } }
[解决办法]