fastreport里使用frxpictureview对象,且datafield属性与blobtype属性也设置成btjpg,但是却出现了jpeg error #52的错误。我在程序中使用了richedit字段将内容传递到sql2000数据库中,但是如果image字段中有内容时就出现了这种错误,为什么呢?请大家明示!
解决方案 »
- 求一个构建界面的例子
- 事件赋值,在线等(急)
- 读取的问题~~~~~~~~~~~~
- 关于注册组件的问题
- 我用代码创建了一个edit1,然后我怎么样才能执行它的Enter事件?
- 请问Delphi里能不能枚举某个目录下的所有文件?
- 请教一个关于用SQL2000的TEXT字段类型写入/取出文本流(问题解决后,立即加分)
- 我要声明一个全局变量,要在哪个窗口中声明啊, 我现在有三个窗口,
- 如何得到TGraphicControl或其子类实例的句柄
- 大家都想知道程的序员待遇问题:所在地、薪水、工作性质。我们都在同一战壕上,面对老板我们心里应该有个数,想吹牛的朋友请您忍一忍。
- 如何获得一个文本的行数,在线等,急!
- 为什么在adoQuery里设的commandTimeOut没有起作用
现在根据我找到的文章,有以下几种方式:
查看修改fr.inc
//------------------- JPEG images -----------------------------------
// JPEG images - only available in Delphi 3 and above. Adds approximately
// 100Kb to your EXE.
// If you want to show jpeg images in "Picture" object, uncomment
// the following line:
{$DEFINE JPEG}
这是原来的格式,不用改动。就是改动成
//------------------- JPEG images -----------------------------------
// JPEG images - only available in Delphi 3 and above. Adds approximately
// 100Kb to your EXE.
// If you want to show jpeg images in "Picture" object, uncomment
// the following line:
//{$DEFINE JPEG}
这种方式也是不好用的。
第二种方式:
修改fr_class.pas
在下面的位置
interface{$I FR.inc}
加入
{$DEFINE JPEG}
且在constructor TfrPictureView.Create;
begin
inherited Create;
Typ := gtPicture;
Picture := TPicture.Create;
Flags := flStretched + flPictRatio;
BaseName := 'Picture';
frConsts['btBMP'] := 0; frConsts['btJPG'] := 1;
frConsts['btICO'] := 2; frConsts['btWMF'] := 3;
frConsts['btjpeg'] := 4;//这一行是我加入的
end;
加入了frConsts['btjpeg'] := 4;
且在
procedure TfrPictureView.DefineProperties;
begin
inherited DefineProperties;
AddProperty('Picture', [frdtHasEditor], frPictureEditor);
AddProperty('Stretched', [frdtBoolean], nil);
AddProperty('Center', [frdtBoolean], nil);
AddProperty('KeepAspect', [frdtBoolean], nil);
AddProperty('DataField', [frdtOneObject, frdtHasEditor, frdtString], frFieldEditor);
AddEnumProperty('BlobType', 'btBMP;btJPG;btICO;btWMF;btJPEG', [0,1,2,3,4]);
//上面的一行经过了修改
//以前是这样的AddEnumProperty('BlobType', 'btBMP;btJPG;btICO;btWMF:', [0,1,2,3]);
end;
中做了修改,现在在frPictureView中已经有了btjpeg这种格式了,但是仍然存在错误
an error occured during calulating [Query1."pic"]
report: frRprt1
Object: picture1
access violation at address 004f8ec1 in module "Main.Exe". Read of address 00000000
请问,是不是我的做法就是不正确的,大家有什么好办法吗?
打印方法是将数据库里的图片存放在一个image对象中,然后在fastreport里使用frxpictureview对象,将image内容赋予frxpictureview对象即可,赋值方法是:tfrxpictureview(frxreport1.FindObject('picture1')).Picture.Assign(image1.Picture.Graphic);
这段放在哪呢?
用richedit保存的在sql图片数据不能打印。如果改成了image显示以后,通过以下方法就可以打印了。
在fastreport的souce文件夹中有一个fr.inc的文件
里面有一段时关于定义jpeg的,把{$DEFINE JPEG}这一句,去掉前面的\\,重新编译fr6.dpk(我用的delphi6.0)。
并且修改fr_report中的BlobType类型为jpg,然后就可以输出了。
由于此问题太简单了,没有人来回答。
我的怎么没有source文件夹呢?是因为我还没有买正版?
yydy#hotmail.com
帮我看看 谢谢