Solved

DirectX by Hori...

Posted on 1998-09-12
3
152 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
ID: 1339518
Background picture of what? Desktop??? Form???
apartment(hahaha)???

0
 
LVL 20

Expert Comment

by:Madshi
ID: 1339519
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
ID: 1339520
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Can't connect to Outlook via TOutlookApplication component 15 124
Delphi cmd execution 6 56
delphi parse string to params 3 101
Adoquery sql  left join does not work 25 81
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

864 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

20 Experts available now in Live!

Get 1:1 Help Now