Setting up background images for forms in Delphi

前端 未结 4 621
后悔当初
后悔当初 2020-12-22 01:48

How can I make my program load an image and make it the background for a form? I need the exact code for it. I\'ve looked all over the internet and the only things I\'ve fo

4条回答
  •  隐瞒了意图╮
    2020-12-22 02:21

    @Brendan

    thanks
    //from Brendan code;
    
    var
    vDest, vRect:  TRect;
    FBackgroundImage: TGraphic;
    begin
    FBackgroundImage := image1.Picture.Graphic; //LOAD from invisible image
    vRect := Rect(0, 0, FBackgroundImage.Width, FBackgroundImage.Height);
    vDest := Rect(0,0,Self.Width, Self.Height);
    Canvas.StretchDraw(vDest, FBackgroundImage);
    end;
    

提交回复
热议问题