我写的程序:unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Db, DBTables, StdCtrls, Buttons, ExtCtrls;type
TForm1 = class(TForm)
Image1: TImage;
BitBtn1: TBitBtn;
Query1: TQuery;
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure TForm1.BitBtn1Click(Sender: TObject);
var
mStream:TMemoryStream;
bmp:TBitmap;
begin
with query1 do
begin
Close;
SQL.Clear;
SQL.Add('select * from ld ');
Open;
if not FieldByName('img').IsNull then begin
mStream:=TMemoryStream.Create ;
bmp:=TBitmap.Create;
TBlobField(FieldByName('img')).SaveToStream(mStream);
mStream.Position :=0;
bmp.LoadFromStream(MStream);
image1.Picture.Assign(bmp);
end
else
begin
image1.Picture :=nil;
end;
end;
mStream.Free;
bmp.Free;
end;
end.问题:
运行程序后只能从数据库中取出原图的一部分,原图大小为700多K,取出的部分只有32K.(所用数据库为SYBASE).
求高人指点问题出在哪里,应该如何解决!
不胜感激!
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Db, DBTables, StdCtrls, Buttons, ExtCtrls;type
TForm1 = class(TForm)
Image1: TImage;
BitBtn1: TBitBtn;
Query1: TQuery;
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure TForm1.BitBtn1Click(Sender: TObject);
var
mStream:TMemoryStream;
bmp:TBitmap;
begin
with query1 do
begin
Close;
SQL.Clear;
SQL.Add('select * from ld ');
Open;
if not FieldByName('img').IsNull then begin
mStream:=TMemoryStream.Create ;
bmp:=TBitmap.Create;
TBlobField(FieldByName('img')).SaveToStream(mStream);
mStream.Position :=0;
bmp.LoadFromStream(MStream);
image1.Picture.Assign(bmp);
end
else
begin
image1.Picture :=nil;
end;
end;
mStream.Free;
bmp.Free;
end;
end.问题:
运行程序后只能从数据库中取出原图的一部分,原图大小为700多K,取出的部分只有32K.(所用数据库为SYBASE).
求高人指点问题出在哪里,应该如何解决!
不胜感激!
解决方案 »
- datasnap clientdataset missing dataprovider
- 操作系统的右键,如何添加,像WinRar,EditPlus等很多软件,是如何实现的?
- 关于在dll中使用线程的问题?
- 超级郁闷问题!都进来看看,不管你现在用不用得到,一定有帮助。。。请求版主帮忙置顶!!!
- 有关DLL问题请高手指点
- 急
- DragQueryFile,DragQueryFile,DragAcceptFiles这三个API函数无法通过编译!win2000,dephi7
- 谁给我发一个7.0的函数大全?
- 求救!Delphi5安装新元件后面板上控件图标显示不正常
- 急!filtered的问题 小弟作揖了!各位大侠!
- 如何通过串口发送一个给定的小数给单片机?
- 奇怪的问题, 大家有没有遇到过
选中你的那个数据库别名,把BLOB SIZE设置的大一点就行了,默认是32K的
(程序看上去没问题)