Einzelnen Beitrag anzeigen

Benutzerbild von Christian S.
Christian S.

Registriert seit: 19. Apr 2003
Ort: Düsseldorf
835 Beiträge
 
#2

Re: BackGroundImage nur einmal

  Alt 8. Jul 2006, 19:07
Kannst Du das nicht einfach selber auf die Form zeichnen?

So in etwa:
Delphi-Quellcode:
type
  MainForm = class(System.Windows.Forms.Form)
  private
    FloadedImage : Image := nil;
  protected
    //...
    method OnPaint(e : PaintEventArgs); override;
  public
    //...
    
    property aImage : String read 'c:\test.jpg';
    property aImageX : Integer read 10;
    property aImageY : Integer read 10;
  end;
    

method MainForm.OnPaint(e : PaintEventArgs);
begin
  if FloadedImage = nil then
    FloadedImage := Image.FromFile(aImage);
    
  e.Graphics.DrawImage(FloadedImage, new Point(aImageX,aImageY));
  
  inherited OnPaint(e);
end;
(Sorry für Chrome-Code, aber habe von Delphi die .NET-Personalities nicht installiert)
Christian S.
Admin in der Entwickler-Ecke
  Mit Zitat antworten Zitat