Struct pic_base64
{
Unsigned char * _pic;//image data buffer
Int _size;//picture size
}
Corresponding Delphi const PicData: TByteDynArray
Var
PicData: TByteDynArray;
MsByte: TMemoryStream;
MsByte:=TMemoryStream. Create;
Try
MsByte. LoadFromFile (filename);//filename to upload picture filename
Setlength (PicData, msByte. Size);
MsByte. Position:=0;
MsByte. Read (PicData [0], msByte) size);
The finally
MsByte. Free;
end;
Ain't that familiar to c + +, can you tell me whether this right?
CodePudding user response:
Front less one parameter, the structure is actually a pointer, pointing to the address of the images, and after 4 bytes is the size of the picture, however, in theory, should be take the size first, read the file again, otherwise could never know how big is the file,