Copy bitmap to painbox

In VCL I can use Canvas.Draw to copy a bitmap to a paintbox canvas. This works ok but when I try the same thing with Web Core I can't seem to get it to work, this is the code I used in TMS Web Core. I placed a button and paintbox onto a web form, and attach the onpaint event. When I click on the button I don't see any line drawn. Am I doing this the right way?


type
  TForm1 = class(TWebForm)
    WebPaintBox1: TWebPaintBox;
    WebButton1: TWebButton;
    procedure WebButton1Click(Sender: TObject);
    procedure WebPaintBox1Paint(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    b : TBitmap;
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.WebButton1Click(Sender: TObject);
begin
  b := TBitmap.Create;
  b.height := WebPaintBox1.Height;
  b.width := WebPaintBox1.Width;
  b.canvas.pen.color := clBlack;
  b.canvas.Pen.width := 2;
  b.Canvas.MoveTo (20, 20);
  b.Canvas.LineTo (400, 300);
  WebPaintBox1.Invalidate;
end;

procedure TForm1.WebPaintBox1Paint(Sender: TObject);
begin
  if b <> nil then
     begin
     WebPaintBox1.Canvas.Draw (0, 0, b);
     end;
end;

Update:

I put beginscence and endscence around the draw but no differece:

     WebPaintBox1.canvas.BeginScene;
     WebPaintBox1.Canvas.Draw (100, 100, b);
     WebPaintBox1.canvas.EndScene;

Update: 


I also tried making a WebLib specific bitmap as in:

b := WEBLib.Graphics.TBitmap.Create;

but no difference. 

One odd thing I notcied about WebLib TGraphic is that is has a FBitmap : TBitmap field that is defined in terms of TGraphic (lines 368 and 415 i WebLib.Grphics.pas). 
Thanks for reporting.
We could see this issue. We did an improvement to make this work in the next update.