请问高手怎么把一张JPEG图片当作MDI主窗体的背景图??
急急

解决方案 »

  1.   

    给你个变通的办法,先将jpg文件读入TJPEGImage,然后转成Tbitmap。
    var
      Form1: TForm1;
      bit:TJPEGImage;
      tempbmp:Tbitmap;implementation{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject);
    begin
      tempbmp:=TBitmap.Create;
      bit:=TJPEGImage.create;
      bit.LoadFromFile('c:\windows\clouds.jpg');
      tempbmp.Assign(bit);
      Form1.Brush.Bitmap:=tempbmp;
    end;procedure TForm1.FormDestroy(Sender: TObject);
    begin
      bit.free;
      tempbmp.free;
    end;
      

  2.   

    jin_zai(进仔) 说说原理可以吗??
      

  3.   

    tempbmp:=TBitmap.Create;//创建一个TBitmap对象,bmp格式
      bit:=TJPEGImage.create;//创建一个TJPEGImage对象,jpg格式
      bit.LoadFromFile('c:\windows\clouds.jpg');//用TJPEGImage对象读取jpg文件
      tempbmp.Assign(bit);//进行jpg>bmp的转换,即用TJPEGImage对象给TBitmap对象符值
      Form1.Brush.Bitmap:=tempbmp;//在mdi背景上平铺图片