title: Setting jpg to bitmap in a TgraphicControl
body: <p>Trying to add a background image to a TGraphicControl. </p>
  
  <p>TCard(TGraphicControl)</p>
  
  <pre><code>Private
    BitMap1:TBitMap;       {Used to store a card image}
  Public
    procedure SetBitmap(image: TBitmap);
  </code></pre>
  
  <p>......</p>
  
  <pre><code> procedure TCard.SetBitmap(image: TBitmap);
   begin
     bitmap1 := Tbitmap.create();
     bitmap1.Assign(image);
     canvas.draw(0,0,bitmap1);
   end;
  </code></pre>
  
  <p>On Form 1 button click , I want to add the image to the tcard component</p>
  
  <pre><code>    procedure TForm1.Button1Click(Sender: TObject);
  var
    image : Tbitmap;
    jpg: TJpegImage;
  begin
    image := TBitmap.create();
    jpg := Tjpegimage.Create();
    jpg.LoadFromFile(dir+'\pics\backcard.jpg');
    image.Assign(jpg);
    card1.setbitmap(image);
    card1.Repaint;
    image.Destroy;
    jpg.Destroy;
   end;
  </code></pre>
  
  <p>When I run this nothing happens. How do I get this image to the background of the TCard component?</p>