Please
Can I export a single page to JPG?
How can I do this!
Thanls
Please
Can I export a single page to JPG?
How can I do this!
Thanls
Sure, this would work like the export to a bitmap or EMF.
var bit: TBitmap;
w, h: Integer;
const pagno = 0;
begin
bit := TBitmap.Create;
w := MulDiv(WPRichText1.Header.PageWidth, WPScreenPixelsPerInch, 1440);
h := MulDiv(WPRichText1.Header.PageHeight-5, WPScreenPixelsPerInch, 1440);;
bit.Width := w;
bit.Height := h;
bit.Canvas.Brush.Color := clWhite;
bit.Canvas.FillRect(Rect(0, 0, w, h));
WPRichText1.PrintPageOnCanvas(bit.Canvas,
Rect(0, 0, w, h), pagno, [ppmPaintTransparent, // ppmPrintFrame,
ppmStretchWidth, ppmStretchHeight, ppmIgnoreSelection, ppmUseEvents], 0);
// Now assign that bitmap to a JPEG or PNG object to save compressed
bit.Free;
end;
Alles anzeigen