Hi
Ihave a problem to print out Texts which have a transparent PNG image in it. The transparent part is printed black. In the Texteditor the transparenz is OK.
Knows somebody a solution?
I use WPTools V6 and Delphi XE
Thanks
Chirstoph
Hi
Ihave a problem to print out Texts which have a transparent PNG image in it. The transparent part is printed black. In the Texteditor the transparenz is OK.
Knows somebody a solution?
I use WPTools V6 and Delphi XE
Thanks
Chirstoph
Are you sure you have the newest version? I also had this problem and I think it is allready solved...
Andreas
I am using 6.14 and it does not work :(
Julian sent me this answer, it should work for you also:
In WPOBJ_Image wird im Druck diese Funktion aufgerufen:
procedure TWPOCustomImage.Paint( toCanvas: TCanvas; BoundsRect: TRect; ParentTxtObj: TWPTextObj; PaintMode: TWPTextObjectPaintModes); var w, h, m: Integer;
Dort wird für den Fall: (wpPaintObjDestIsPDF in PaintMode)
besonderer Code aufgerufen.
Ergänzen Sie diesen Teil so, dass er auch in dem Fall
not (wpPaintObjInEditor in PaintMode)
was gleichbedeutend mit Ausdrucken ist.
if (wpPaintObjDestIsPDF in PaintMode) and (Graphic <> nil) and (Graphic is TPngObject) then
begin
if (wpPaintObjDestIsPDF in PaintMode) or
(TPngObject(Graphic).Transparent and
((TPngObject(Graphic).Width<>BoundsRect.Right-BoundsRect.Left) or
(TPngObject(Graphic).Height<>BoundsRect.Bottom-BoundsRect.Top)))
then
begin
abit := TBitmap.Create;
w := Abs(TPngObject(Graphic).Width);
h := Abs(TPngObject(Graphic).Height);
abit.Width := w;
abit.Height := h;
abit.PixelFormat := pf24bit;
try
TPngObject(Graphic).Draw(abit.Canvas, Rect(0,0, w,h));
SetStretchBltMode(toCanvas.Handle, HALFTONE);
{$IFDEF WP6} sStart; {$ENDIF} //=WP6
toCanvas.StretchDraw(BoundsRect, aBit);
{$IFDEF WP6} sEnd; {$ENDIF} //=WP6
finally
abit.Free;
end;
end else
begin
{$IFDEF WP6} sStart; {$ENDIF} //=WP6
TPngObject(Graphic).Draw(toCanvas, BoundsRect);
{$IFDEF WP6} sEnd; {$ENDIF} //=WP6
end;
end else
Alles anzeigen
Dann sollte es gehen, da dann eine zwischen bitmap verwendet wird.
It is in German, but your name suggest you understand German, do you?
Greetings
Andreas
Danke für die Antwort.
Dieser Code steht schon so in der Unit WPOBJ_Image.
Also das Problem besteht weiter, ausser ich brauche keine transparenten PNGs und mache es mit WMFs, denn da geht es gut.
Liebe Grüsse
Christoph
Sorry. Julian, this is for you, then...
Andreas