How to Get a transparent BitMap from TRVMathItemInfo item?

General TRichView support forum. Please post your questions here
Post Reply
fara2000
Posts: 42
Joined: Mon Sep 07, 2015 5:59 pm

How to Get a transparent BitMap from TRVMathItemInfo item?

Post by fara2000 »

Hello Sergey
I used the following code to convert a latex text into a bitmap...
Every thing runs well except that the Bitmap produced is not transparent as I wish...
Please what I mess here?? Thanks in advance!!

procedure TForm9.Button1Click(Sender: TObject);
var rv:trichViewEdit;
Item: TRVMathItemInfo;
st:string;
Bit:TBitmap;
begin
rv := TRichViewEdit.Create(nil);
try
rv.Style := RvStyle1;
st := '\frac{x}{y}';
Item := TRVMathItemInfo.Create(rv.RVData);
Item.Text := st;
Item.FontSizeDouble :=40;
Item.TextColor := clRed;

// Create the bitmap with a transparent background color (e.g., clWhite)
Bit := Item.AsBitmap(rv.RVData, clWhite);
Bit.Transparent := True;
Bit.TransparentColor := clWhite;
Image1.Picture.Assign(Bit);
finally
rv.Free;
end;
end;
fara2000
Posts: 42
Joined: Mon Sep 07, 2015 5:59 pm

Re: How to Get a transparent BitMap from TRVMathItemInfo item?

Post by fara2000 »

Ok I found the problem... I should set the transparent property of timage to true...
Post Reply