Solved

DirectX by Hori...

Posted on 1998-09-12
3
151 Views
Last Modified: 2010-04-06
I don't know how to set background picture (:-)
0
Comment
Question by:ssdjgru1
3 Comments
 
LVL 1

Expert Comment

by:duke_n
Comment Utility
Background picture of what? Desktop??? Form???
apartment(hahaha)???

0
 
LVL 20

Expert Comment

by:Madshi
Comment Utility
I suppose he means his apartment...

But this is not the right forum for this question!   :-)
0
 
LVL 10

Accepted Solution

by:
viktornet earned 100 total points
Comment Utility
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

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now