Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

DirectX by Hori...

Posted on 1998-09-12
3
Medium Priority
?
159 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 400 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

876 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