Black background with gif and png

General TRichView support forum. Please post your questions here
Post Reply
Jim Knopf
Posts: 241
Joined: Mon Dec 30, 2013 10:07 pm
Location: Austria
Contact:

Black background with gif and png

Post by Jim Knopf »

If I print to pdf (using TWPPDFPrinter), the background of png and gif images is black. Also if I export one page out of TSRichViewEdit to a wmf file it's the same.
Btw: The regular view in TSRichViewEdit is perfect, printing to printer too. Only not to pfd (and wmf).

I tried out a lot of combinations of transparencymodes an -colors and some more but alwas the same result.

Code: Select all

var
  Pic: TPicture;
  PNam: TRVAnsiString;
  PTag: TRVTag;
  Al: TRVVAlign;
  He, Wi, Wi2, Pi, Pr, PaV, PaH, Co, CoB: Integer;
  Alt: string;
begin
(. . . got from another TRichViewEdit . . .)
  Pic := TPicture.Create;
  try
    Pic.LoadFromFile(PicNam);
    Gr := RV_CreateGraphics(TGraphicClass(pic.Graphic.ClassType));
    Gr.Assign(Pic.Graphic);
    R.AddPictureEx(PicNam, Gr, TargPa[PNr], Al);
    R.SetItemExtraStrProperty(R.ItemCount-1, rvespImageFileName, PicNam);
    R.SetItemExtraIntProperty(R.ItemCount-1, rvepImageWidth, Wi);
    R.SetItemExtraIntProperty(R.ItemCount-1, rvepImageHeight, He);
    R.SetItemExtraIntProperty(R.ItemCount-1, rvepSpacing, Pi);
    R.SetItemExtraIntProperty(R.ItemCount-1, rvepBorderWidth, Pr);
    R.SetItemExtraIntProperty(R.ItemCount-1, rvepOuterVSpacing, PaV);
    R.SetItemExtraIntProperty(R.ItemCount-1, rvepOuterHSpacing, PaH);
    R.SetItemExtraIntProperty(R.ItemCount-1, rvepColor, Co);
//    R.SetItemExtraIntProperty(R.ItemCount-1, rvepColor, clWhite);   < no effect
    R.SetItemExtraIntProperty(R.ItemCount-1, rvepBorderColor, CoB);
//    R.SetItemExtraIntProperty(R.ItemCount-1, rvepTransparent, 1);   < no effect
//    R.SetItemExtraIntProperty(R.ItemCount-1, rvepTransparentColor , clWhite);   < no effect
  finally
    Pic.Free;
  end;
. . .
end;
// = some of the trials

Do you have a hint?
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

ScaleRichView does not support picture transparency when printing. We are currently working on this problem.
Jim Knopf
Posts: 241
Joined: Mon Dec 30, 2013 10:07 pm
Location: Austria
Contact:

Post by Jim Knopf »

Okay, so I'm looking forward your solution - thank you
Post Reply