掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
背景に画像を並べたい (ID:8205)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
> アドレス記載してますが... いっぱい「背景」があってどの背景か分かりません。 たとえば、Form1 の背景を画像を並べて表示するには、PaintBox1 をおいて type TForm1 = class(TForm) PaintBox1: TPaintBox; procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure PaintBox1Paint(Sender: TObject); private { Private 宣言 } public bmp:TBitmap; end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.FormCreate(Sender: TObject); begin PaintBox1.Align := alClient; bmp := TBitmap.Create; bmp.LoadFromFile('C:\Delphi5\Borland Shared\Images\Splash\256Color\shipping.bmp'); end; procedure TForm1.FormDestroy(Sender: TObject); begin bmp.Free; end; procedure TForm1.PaintBox1Paint(Sender: TObject); var iw,ih,w,h:integer; begin w := PaintBox1.Width div bmp.Width +1; h := PaintBox1.Height div bmp.Height +1; for ih := 0 to h-1 do for iw := 0 to w-1 do PaintBox1.Canvas.Draw(bmp.Width*iw,bmp.Height*ih,bmp); end;
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.