1 procedure SavePic;
2 var
3 tmpStream:TROBinaryMemoryStream;
4 VBinaryMidService:IBinaryMidService;
5 begin
6 tmpStream:=TROBinaryMemoryStream.Create;
7 VBinaryMidService:=TBinaryMidService_Proxy.Create(ROMessage,ROChannel);
8 Image1.Picture.Graphic.SaveToStream(tmpStream) ;
9 VBinaryMidService.Add('0001',PicType,tmpStream);
10 end;
function TBinaryMidService.Add(Const ANum: AnsiString; const AType: AnsiString; const AValue: Binary): Integer;
var
tmpSQLStr:string;
begin
tmpSQLStr:=format('insert into test(num,AType,pic) values (%s,%s,:0)',[quotedstr(ANum),quotedstr(AType)]);
DBOrder.AddPic(tmpSQLStr,AValue);
end;
//--------------ucDBOrder----------------------
function DBOrder.AddPic(ASQLStr:string;AValue)
var
QryTDB:TADOQuery;
begin
QryTDB:= TADOQuery.Create(nil);
QryTDB.Close;
QryTDB.SQL.Clear;
QryTDB.Connection:=Conn;
QryTDB.SQL.Add(SQLStr);
QryTDB.Parameters.ParamByName('1').LoadFromStream(AValue,ftBlob);
QryTDB.ExecSQL;
FreeAndNil(QryTDB);
end;
1 procedure showPic;
2 var
3 Data:Variant;
4 VBinaryMidService:IBinaryMidService;
5 PicFile:TGraphic;
6 begin
7 //得到数据赋值给
8 VBinaryMidService:=TBinaryMidService_Proxy.Create (ROMessage,ROChannel);
9 VBinaryMidService.GetPic('00001',Data);
10 ClientDataSet.Data:=Data;
11 //显示图片
12 if not ClientDataSet1.FieldByName('Pic').IsNull then
13 begin
14 if ClientDataSet1.FieldByName('PicType').AsString='BMP' then
15 //显示bmp文件
16 PicFile:=TBitmap.Create;
17 else
18 if ClientDataSet1.FieldByName('PicType').AsString='JPG' then
19 begin
20 //显示JPG文件
21 PicFile:=TJPEGImage.Create;
22 end else
23 if ClientDataSet1.FieldByName('PicType').AsString='ICO' then
24 begin
25 //显示ICO文件
26 //IcoFile:=TIcon.Create; // IcoFile.Free;
27 PicFile:=TIcon.Create;
28 end else
29 if ClientDataSet1.FieldByName('PicType').AsString='PNG' then
30 begin
31 //显示PNG文件
32 PicFile:=TPNGObject.Create;
33 end else
34 if ClientDataSet1.FieldByName('PicType').AsString='GIF' then
35 begin
36 //显示PNG文件
37 PicFile:=TGIFImage.Create;
38 end;
39 mStream:=TMemoryStream.Create ;
40 TBlobField(ClientDataSet1.FieldByName('Pic')).SaveToStream(mStream);
41 mStream.Position :=0;
42 PicFile.LoadFromStream(MStream);
43
44 image1.Picture.Assign(PicFile);
45 PicFile.Free;
46 mStream.Free;
47 end;
48 end;
创造与魔法 安卓版v1.0.0750
创造与魔法是一款开放世界手游,在游戏中玩家可探索这个奇妙的世
创造与魔法修改版 最新版v1.0.0750
创造与魔法无限点券版是款探索冒险游戏,该款游戏的操作还是蛮自
战争与文明官方版本 安卓版v1.7.16
战争与文明是一款由上海邮通科技有限公司开发的战争策略游戏,这
迷你世界0元领皮肤无限迷你币版 最新安卓版v1.43.0
迷你世界0元购买皮肤版是这款开放沙盒冒险建造游戏的特殊破解版
创造与魔法无限经验版 安卓版v1.0.0750
创造与魔法无限经验版是款可以改造环境,整个游戏的自由度还是蛮