Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

DirectX by Hori...

Posted on 1998-09-12
3
154 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

789 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