Необходимо изменить программу
http://www.delphisources.ru/pages/so...year/lamp.html так, что б под темным фоном был не скрин рабочего стола, а заданное изображение.
Код:
var
Form1: TForm1;
orig, temp: TBitmap;
r : TRect;
hypotenuse : Array of Array of Integer;
procedure TForm1.FormCreate(Sender: TObject);
var
c : TCanvas;
i, j : Integer;
begin
DoubleBuffered := true;
ShowCursor(false);
Top := 0;
Left := 0;
ClientWidth := Screen.Width;
ClientHeight := Screen.Height;
r := Rect(0 , 0, ClientWidth, ClientHeight);
orig := TBitmap.Create;
orig.PixelFormat := pf24Bit;
orig.Width := ClientWidth;
orig.Height := ClientHeight;
temp := TBitmap.Create;
temp.Canvas.Brush.Color := clBlack;
temp.PixelFormat := pf24Bit;
temp.Width := ClientWidth;
temp.Height := ClientHeight;
c := TCanvas.Create;
try
c.Handle := GetWindowDC(GetDesktopWindow); // насколько я понял - эта процедура "подкладывает" рабочий стол под тьму.
orig.Canvas.CopyRect(r, c, r);
finally
c.Free;
end;
Canvas.Draw(0, 0, orig);
setLength(hypotenuse, d+1, d+1);
for i := 0 to d do for j := 0 to d do hypotenuse[i, j] := Round(Hypot(i, j));
end;
Но присвоить изображение переменным с или orig не удалось.