You are not logged in.
Pages: 1
Several fixes in RenderMetaFile:
Added fNewPath := False to TPdfCanvas.DrawXObjectEx. Without this code, lines after the image is not drawn correctly.
procedure TPdfCanvas.DrawXObjectEx(X, Y, AWidth, AHeight: Single;
ClipX, ClipY, ClipWidth, ClipHeight: Single; const AXObjectName: PDFString);
begin
DrawXObjectPrepare(AXObjectName);
GSave;
Rectangle(ClipX, ClipY, ClipWidth, ClipHeight);
Clip;
NewPath;
fNewPath := False;
ConcatToCTM(AWidth, 0, 0, AHeight, X, Y);
ExecuteXObject(AXObjectName);
GRestore;
end;
Added EMR_TRANSPARENTBLT and setting "Color Key Masking" attribute for image. Perhaps it should be done more accurately. PDF spec is not clear about how to do this for 8-bit images.
Added hack to mirror image when WorldTransform.eM22 has negative value, i.e. "Vertical reflection component" in http://msdn.microsoft.com/en-us/library … s.85).aspx
EMR_STRETCHDIBITS:
with PEMRStretchDIBits(R)^ do // only handle RGB bitmaps (no palette)
if (offBmiSrc<>0) and (offBitsSrc<>0) then begin
if WorldTransform.eM22 < 0 then
with PBitmapInfo(PtrUInt(R)+offBmiSrc)^ do
bmiHeader.biHeight := -bmiHeader.biHeight;
There also may be "Horizontal reflection component" in WorldTransform.eM11. Reflection can be done by changing sign of image width or height parameter in StretchDIBits call.
Offline
I've added those enhancements.
See http://synopse.info/fossil/info/c1b5c0772a
Thanks!
Offline
Pages: 1