THTMLabel.HTMLPrint

Hi All,

I am currently looking for ways to render an HTML string to a bitmap in the background and have stumbled across THTMLablel.HTMLPrint. I cannot get it to print to a canvas that I give it (TImage) it just paints black... It appears to be an undocumented feature. Is anyone able to shed any light on this function?

Cheers

Daz

Was retested and this works fine here:


var
  bmp: TBitmap;
begin
  bmp := TBitmap.Create;
  bmp.Width := 300;
  bmp.Height := 300;
  HTMLabel1.HTMLText.Text := 'Hello <i>world</i>';
  HTMLabel1.HTMLPrint(bmp.Canvas, Rect(0,0,300,300));
  bmp.SaveToFile('e:\tms\temp\htmlbmp.bmp');
  bmp.Free;
end;

Thanks Bruno - I shall have a poke about in my code and see what is happening :-)


Interesting! It paints to a bitmap as in your code but not to a TImage.picture.bitmap.... No worries :-)


Daz