fastreport 图片问题 ( 积分: 50 )

  • 主题发起人 主题发起人 landersxu
  • 开始时间 开始时间
L

landersxu

Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TSDIAppForm.frReport2BeforePrint(Memo: TStringList;
View: TfrView);
var
jpeg: Tjpegimage;
c: array[0..9] of tcolor;
k: array[0..9] of string;
tempbmp: tbitmap;
i, j: Integer;
ct: Boolean;
wcs: Integer;

begin

for i := 1 to colorsheet.StringGrid1.rowcount - 1do
begin
getcolor(colorsheet.StringGrid1.Cells[1, i], ExtractFilePath(ParamStr(0)) +
'color.cpt', c[0], ct);
getcolor(colorsheet.StringGrid1.Cells[2, i], ExtractFilePath(ParamStr(0)) +
'color.cpt', c[1], ct);
getcolor(colorsheet.StringGrid1.Cells[3, i], ExtractFilePath(ParamStr(0)) +
'color.cpt', c[2], ct);
getcolor(colorsheet.StringGrid1.Cells[4, i], ExtractFilePath(ParamStr(0)) +
'color.cpt', c[3], ct);
getcolor(colorsheet.StringGrid1.Cells[5, i], ExtractFilePath(ParamStr(0)) +
'color.cpt', c[4], ct);
getcolor(colorsheet.StringGrid1.Cells[6, i], ExtractFilePath(ParamStr(0)) +
'color.cpt', c[5], ct);
getcolor(colorsheet.StringGrid1.Cells[7, i], ExtractFilePath(ParamStr(0)) +
'color.cpt', c[6], ct);
getcolor(colorsheet.StringGrid1.Cells[8, i], ExtractFilePath(ParamStr(0)) +
'color.cpt', c[7], ct);
getcolor(colorsheet.StringGrid1.Cells[9, i], ExtractFilePath(ParamStr(0)) +
'color.cpt', c[8], ct);
tempbmp := tbitmap.Create;
jpeg := Tjpegimage.Create;
with viewfiledo
begin
if RadioButton1.Checked then
wcs := 1;
if RadioButton2.Checked then
wcs := 2;
if RadioButton3.Checked then
wcs := 3;
tempbmp := convbmp(jc5bmp,
StrToInt(Edit1.Text),
StrToInt(Edit2.Text),
StrToInt(Edit3.Text),
StrToInt(Edit4.Text),
StrToInt(Edit5.Text),
StrToInt(Edit6.Text),
StrToInt(Edit7.Text),
StrToInt(Edit8.Text),
StrToInt(edit10.Text),
StrToInt(edit10.Text) + StrToInt(label4.Caption),
StrToInt(Edit9.Text),
c[1],
c[2],
c[3],
c[4],
c[5],
c[6],
c[7],
c[8],
c[0],
wcs,
spinedit1.Value);
end;
jpeg.Assign(tempbmp);
tempbmp.Free;
if (View is TfrPictureView) and ((View as TfrPictureView).Name = 'cpic') then
begin
(View as TfrPictureView).Picture.Assign(jpeg);
end;
jpeg.Free;
end;
end;


cpic放在band上不能显示图片,不放在band 上只能显示一个.
 
procedure TSDIAppForm.frReport2BeforePrint(Memo: TStringList;
View: TfrView);
var
jpeg: Tjpegimage;
c: array[0..9] of tcolor;
k: array[0..9] of string;
tempbmp: tbitmap;
i, j: Integer;
ct: Boolean;
wcs: Integer;

begin

for i := 1 to colorsheet.StringGrid1.rowcount - 1do
begin
getcolor(colorsheet.StringGrid1.Cells[1, i], ExtractFilePath(ParamStr(0)) +
'color.cpt', c[0], ct);
getcolor(colorsheet.StringGrid1.Cells[2, i], ExtractFilePath(ParamStr(0)) +
'color.cpt', c[1], ct);
getcolor(colorsheet.StringGrid1.Cells[3, i], ExtractFilePath(ParamStr(0)) +
'color.cpt', c[2], ct);
getcolor(colorsheet.StringGrid1.Cells[4, i], ExtractFilePath(ParamStr(0)) +
'color.cpt', c[3], ct);
getcolor(colorsheet.StringGrid1.Cells[5, i], ExtractFilePath(ParamStr(0)) +
'color.cpt', c[4], ct);
getcolor(colorsheet.StringGrid1.Cells[6, i], ExtractFilePath(ParamStr(0)) +
'color.cpt', c[5], ct);
getcolor(colorsheet.StringGrid1.Cells[7, i], ExtractFilePath(ParamStr(0)) +
'color.cpt', c[6], ct);
getcolor(colorsheet.StringGrid1.Cells[8, i], ExtractFilePath(ParamStr(0)) +
'color.cpt', c[7], ct);
getcolor(colorsheet.StringGrid1.Cells[9, i], ExtractFilePath(ParamStr(0)) +
'color.cpt', c[8], ct);
tempbmp := tbitmap.Create;
jpeg := Tjpegimage.Create;
with viewfiledo
begin
if RadioButton1.Checked then
wcs := 1;
if RadioButton2.Checked then
wcs := 2;
if RadioButton3.Checked then
wcs := 3;
tempbmp := convbmp(jc5bmp,
StrToInt(Edit1.Text),
StrToInt(Edit2.Text),
StrToInt(Edit3.Text),
StrToInt(Edit4.Text),
StrToInt(Edit5.Text),
StrToInt(Edit6.Text),
StrToInt(Edit7.Text),
StrToInt(Edit8.Text),
StrToInt(edit10.Text),
StrToInt(edit10.Text) + StrToInt(label4.Caption),
StrToInt(Edit9.Text),
c[1],
c[2],
c[3],
c[4],
c[5],
c[6],
c[7],
c[8],
c[0],
wcs,
spinedit1.Value);
end;
jpeg.Assign(tempbmp);
tempbmp.Free;
if (View is TfrPictureView) and ((View as TfrPictureView).Name = 'cpic') then
begin
(View as TfrPictureView).Picture.Assign(jpeg);
end;
jpeg.Free;
end;
end;


cpic放在band上不能显示图片,不放在band 上只能显示一个.
 
不要JPEG,直接就将
(View as TfrPictureView).Picture.Assign(jpeg);
改成
if (View is TfrPictureView) and ((View as TfrPictureView).Name = 'cpic') then
begin
(View as TfrPictureView).Picture.Assign(tempbmp);
end;
tempbmp.Free;
这样行不行???
 
上面还漏了一点
(View as TfrPictureView).Picture.Assign(tempbmp);
改成
(View as TfrPictureView).Picture.Bitmap.Assign(tempbmp);
 
cpic放在band上不能显示图片,不放在band 上只能显示一个.
还是没用
 
还有我的程序不带数据库
 
后退
顶部