16,748
社区成员
发帖
与我相关
我的任务
分享
var
MM:TStringStream;
Re:String;
newNode, newNodeAdd: IXMLNode;
begin
MM:=TStringStream.Create('');
Img1.Picture.Bitmap.SaveToStream(MM);
MM.Position:=0;
Re:=StrToBase64(MM.DataString);
XMLDocument1.XML.Clear;
XMLDocument1.Active := True; {必须先激活}
XMLDocument1.Version := '1.0'; {设置版本}
XMLDocument1.Encoding := 'GB2312';
newNode := XMLDocument1.AddChild('科室名单');
newNodeAdd:=newNode.AddChild('人员');
newNodeAdd.SetAttribute('职务', Re);
XMLDocument1.SaveToFile('D:\4.XML');
Showmessage(Inttostr(MM.Size));
MM.Free;
var
MM:TStringStream;
Tem:Base64String;
begin
Tem:=XMLDocument1.DocumentElement.ChildNodes[0].Attributes['职务'];
Tem:=Base64ToStr(Tem);
MM:=TStringStream.Create(Tem);
MM.Position:=0;
Showmessage(Inttostr(MM.Size));
IMG2.Picture.Bitmap.LoadFromStream(mm);
mm.Free;