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;
敢达决战官方正版 安卓版v6.7.9
下载敢达决战 安卓版v6.7.9
下载像素火影骨架佐助 (Perseverance Fire Shadow)手机版v1.16
下载要塞英雄 安卓版v33.20.0-39082670-Android
下载梦想城镇vivo最新版本 安卓版v12.0.1
梦想城镇vivo版是这款卡通风模拟经营类手游的渠道服版本,玩
怦然心动的瞬间 安卓版v1.0
怦然心动的瞬间是一款真人向的恋爱互动游戏,在游戏中玩家将扮演
曼尼汉堡店游戏 安卓版v1.0.3
曼尼汉堡店是一款非常好玩的精品恐怖类型冒险游戏,在这款游戏中
现代总统模拟器去广告版 安卓版v1.0.46
现代总统模拟器是一款休闲养成类游戏,可能对于不少的玩家来说都
现代总统模拟器付费完整版 安卓版v1.0.46
现代总统模拟器高级版在商店是需要付费的,相对于普通版本,高级