Hi John
If you use a TIERichEdit, then you can easily load an RTF file and output it to an image of any size:
const
Out_Width = 500;
Out_Height = 800;
Text_Margin = 20;
var
re : TIERichEdit;
bmp: TIEBitmap;
textRect: TRect;
begin
bmp := TIEBitmap.Create;
re := TIERichEdit.CreateParented(HWND(HWND_MESSAGE));
try
re.Visible := False;
re.WordWrap := False;
re.OpenFromFile( 'D:\RTF Document.rtf' );
bmp.width := Out_Width;
bmp.height := Out_Height;
textRect := Rect( Text_Margin,
Text_Margin,
Out_Width - Text_Margin,
Out_Height - Text_Margin );
re.PaintTo( bmp, textRect, iehCenter, ievCenter, True );
bmp.Write('D:\RtfImage.jpeg' );
finally
bmp.Free;
re.Free;
end;
end;
Info: https://www.imageen.com/help/TIERichEdit.PaintTo.html
With regard to tablets, are you looking to get the Screen.Width/Height?
Nigel
Xequte Software
www.imageen.com