DirectX by Hori...

I don't know how to set background picture (:-)
ssdjgru1Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
viktornetConnect With a Mentor Commented:
Try this  (:-)
------------
-------First way....----

In OnCreate() of the form

bmpBackground := TBitmap.Create;
bmpBackground.LoadFromFile( 'c:\windows\setup.bmp' );

inOnPaint() of the form

Canvas.Draw( 0, 0, bmpBackground );

in OnDestroy() of the form

bmpBackground.Free;
--------Second way--------------

procedure Tile(c:TCanvas;b:TBitMap);
  var
    x,y,h,w,i,j:integer;
  begin
    with b do begin
      h:=b.height;
      w:=b.width;
      end;
    y:=0;
    with c.Cliprect do begin
      i:=bottom-top-1; //height
      j:=right-left-1; //width
      end;
    while y<i do begin
      x:=0;
      while x<j do begin
        c.draw(x,y,b);
        inc(x,w);
        end;
      inc(y,h);
      end;
  end;

procedure TForm.OnPaint(Sender: TObject);
begin
  if Sender is TForm then
    Tile(TForm(Sender).Canvas,YourBitmap);
end;
-----------
Regards,
Viktor Ivanov
0
 
duke_nCommented:
Background picture of what? Desktop??? Form???
apartment(hahaha)???

0
 
MadshiCommented:
I suppose he means his apartment...

But this is not the right forum for this question!   :-)
0
All Courses

From novice to tech pro — start learning today.