TTMSFMXGrid Bitmap quality

Hi,
I am trying to add bitmap to my grid but quality I am getting it is bad.
I am using:
TTMSFMXGrid.AddBitmap(0,0,TTMSFMXBitmapContainer.FindBitmap('Headher Portrait'),TAlignLayout.MostLeft,562,112);
when I am using
TTMSFMXRichEditor.InsertImage(TPicture(TTMSFMXBitmapContainer.FindBitmap('Headher Portrait')),562,112);
quality is good.
Can you help me, please.

Thank you in advance,

Hi,

Please note that the bitmap is automatically resized based on the cell size. Can you please show us a screenshot of the quality and the settings of the grid?

First link shows print out of the grid

Second show print out of the RichEditorPdfIO

Pictures are exactly same, same source.

Here is settiong of gridpdfIO
object pdf_portfolio: TTMSFMXGridPDFIO
Size.Width = 26.000000000000000000
Size.Height = 26.000000000000000000
Size.PlatformDefault = False
Position.X = 752.000000000000000000
Position.Y = 16.000000000000000000
Grid = sg_portfolio
Options.OpenInPDFReader = True
Options.DefaultFont.Name = 'Arial'
Options.Margins.Left = 20.000000000000000000
Options.Margins.Top = 50.000000000000000000
Options.Margins.Right = 20.000000000000000000
Options.Margins.Bottom = 50.000000000000000000
Options.HeaderFont.Name = 'Georgia'
Options.FooterFont.Name = 'Arial'
Options.HeaderSize = 0.000000000000000000
Options.HeaderMargins.Left = 5.000000000000000000
Options.HeaderMargins.Top = 5.000000000000000000
Options.HeaderMargins.Right = 5.000000000000000000
Options.HeaderMargins.Bottom = 5.000000000000000000
Options.HeaderAlignment = gtaLeading
Options.FooterSize = 0.000000000000000000
Options.FooterMargins.Left = 5.000000000000000000
Options.FooterMargins.Top = 5.000000000000000000
Options.FooterMargins.Right = 5.000000000000000000
Options.FooterMargins.Bottom = 5.000000000000000000
Options.PageNumber = pnFooter
Options.PageNumberMargins.Left = 10.000000000000000000
Options.PageNumberMargins.Top = 5.000000000000000000
Options.PageNumberMargins.Right = 10.000000000000000000
Options.PageNumberMargins.Bottom = 5.000000000000000000
Options.PageNumberFormat = '%d'
Options.PageNumberFont.Name = 'Arial'
Options.PageNumberSize = 12.000000000000000000
Options.FitToPage = False
Options.CellLayout = gclNone
end
and here grid
object sg_portfolio: TTMSFMXGrid
Align = Client
DisableFocusEffect = False
TabOrder = 2
Size.Width = 1088.000000000000000000
Size.Height = 559.000000000000000000
Size.PlatformDefault = False
FixedColumns = 0
FixedRows = 0
ColumnCount = 1
RowCount = 0
Options.Editing.CalcFormat = '%g'
Options.Grouping.CalcFormat = '%g'
Options.Grouping.GroupCountFormat = '(%d)'
Options.IO.XMLEncoding = 'ISO-8859-1'
Options.Mouse.TouchScrollingSensitivity = 0.100000001490116100
Options.Printing.PageNumberFormat = '%g'
Version = '2.3.3.3'
Fill.Kind = Solid
Stroke.Kind = Solid
TopRow = 0
LeftCol = 0
OnGetCellLayout = sg_portfolioGetCellLayout
Columns = <
item
Color = claNull
Editor = etEdit
Fixed = False
FixedFont.Style = [fsBold]
FixedFontColor = claBlack
FontColor = claBlack
ID = ''
Width = 68.000000000000000000
end
item
Color = claNull
Editor = etEdit
Fixed = False
FixedFont.Style = [fsBold]
FixedFontColor = claBlack
FontColor = claBlack
ID = ''
Width = 68.000000000000000000
end
item
Color = claNull
Editor = etEdit
Fixed = False
FixedFont.Style = [fsBold]
FixedFontColor = claBlack
FontColor = claBlack
ID = ''
Width = 68.000000000000000000
end
item
Color = claNull
Editor = etEdit
Fixed = False
FixedFont.Style = [fsBold]
FixedFontColor = claBlack
FontColor = claBlack
ID = ''
Width = 68.000000000000000000
end
item
Color = claNull
Editor = etEdit
Fixed = False
FixedFont.Style = [fsBold]
FixedFontColor = claBlack
FontColor = claBlack
ID = ''
Width = 68.000000000000000000
end>
end
end
end

here is what happens when grid is filled:
procedure Tfrm_Portfolio.LoadClick(Sender: TObject);
var str,str_portfolio_members,str_instructors:string;
i_student,i_curRow,i_rows,i_curCol,i_cols,i_students,i,i_w,i_ws:integer;
d_sum,d_partSum:double;
My4:T4_string;
Client:array of integer;
begin
str_portfolio_members:=''; str_instructors:='';
for I := 1 to sg_scan_2.RowCount-2 do begin
if str_portfolio_members<>'' then str_portfolio_members:=str_portfolio_members+',';
str_portfolio_members:=str_portfolio_members+sg_scan_2.cells[1,i];

if (sg_scan_2.Cells[3,i]<>'') and (sg_scan_2.Cells[3,i]<>null) then begin
if str_instructors<>'' then str_instructors:=str_instructors+',';
str_instructors:=str_instructors+sg_scan_2.cells[3,i];
end;

end;
str_portfolio_members:='(' + str_portfolio_members +')';
str_instructors:='(' + str_instructors + ')';
i_w:=round(sg_portfolio.ColumnWidths[0]);
sg_portfolio.ColumnWidths[1]:=3*i_w;
sg_portfolio.ColumnWidths[3]:=round(i_w/2);
sg_portfolio.ColumnWidths[4]:=round(i_w/2);
sg_portfolio.ColumnWidths[6]:=round(i_w/2);
sg_portfolio.ColumnWidths[7]:=round(i_w/2);

for I := 0 to sg_portfolio.ColumnCount-1 do
i_ws:=i_ws+round(sg_portfolio.ColumnWidths[i]);

setlength(client,form1.lb_service_index.Items.Count+1);
sg_portfolio.Clear;
sg_portfolio.ColumnCount:=8;

i_rows:=1; i_curRow:=0;
sg_portfolio.RowCount:=1; i_rows:=1;
sg_portfolio.MergeCells(0,i_currow,8,1);
sg_portfolio.AddBitmap(0,0,form1.Header_img.FindBitmap('Headher Portrait'),TAlignLayout.MostLeft,562,112); //1000,180
sg_portfolio.RowHeights[i_currow]:=124;
sg_portfolio.FontNames[0,i_currow]:='Georgia'; sg_portfolio.FontSizes[0,i_currow]:=14;
sg_portfolio.FontNames[1,i_currow]:='Georgia'; sg_portfolio.FontSizes[0,i_currow]:=14;

i_rows:=i_rows+1; i_currow:=i_rows-1;
sg_portfolio.RowCount:=i_rows;
sg_portfolio.MergeCells(0,i_curRow,8,1);
sg_portfolio.Cells[0,i_currow]:='Portfolio';
sg_portfolio.FontNames[0,i_currow]:='Georgia'; sg_portfolio.FontSizes[0,i_currow]:=14; sg_portfolio.FontStyles[0,i_currow]:=Label34.Font.Style;

i_rows:=i_rows+1;

for i := 0 to length(Client)-1 do
client[i]:=0;
i_rows:=i_rows+1; i_currow:=i_rows-1;
sg_portfolio.RowCount:=i_rows;

//fmx.TMSGrid.TTMSFMXGrid.DesignBorderColor:=0;
sg_portfolio.MergeCells(0,i_curRow,8,1);
sg_portfolio.Cells[0,i_currow]:='Your balance by category:';
sg_portfolio.FontNames[0,i_currow]:='Georgia'; sg_portfolio.FontSizes[0,i_currow]:=14; sg_portfolio.FontStyles[0,i_currow]:=Label34.Font.Style;
i_rows:=i_rows+1;
sg_portfolio.RowCount:=i_rows; i_curRow:=i_curRow+1;
sg_portfolio.MergeCells(0,i_curRow,8,1);
sg_portfolio.Cells[0,i_curRow]:='';

i_students:=sg_scan_2.RowCount-2;
d_sum:=0;

rest is just conditions all setting is done in code above.

I think it would be better to use TTMSFMXPDFLib instead, and create your own grid structure to output to PDF. The grid is doing bitmap manipulations to fit the bitmap into the cell and this can be the reason why the quality is less than output on TTMSFMXRichEditor. If you use the TTMSFMXPDFLib you can control the position and size. We'll meanwhile investigate why the quality is different.