![]() |
Omagen de fondo Form MDI
Como se puede poner una imagen de fondo en un formulario MDI en Delphi 7? Es decir en formulario principal de una aplicación.
Gracias, saludos.- Silvio.- |
Fondo
Te pongo un ejemplo...
Espero que te sirva y FLIZ NAVIDAD !! :) ...... private FClientInstance : TFarProc; FPrevClientProc : TFarProc; procedure ClientWndProc(var Message: TMessage); ... procedure TFormMain.FormCreate(Sender: TObject); begin FClientInstance := MakeObjectInstance(ClientWndProc); FPrevClientProc := Pointer(GetWindowLong(ClientHandle,GWL_WNDPROC)); SetWindowLong(ClientHandle,GWL_WNDPROC, LongInt(FClientInstance)); end; procedure TFormMain.ClientWndProc(var Message: TMessage); var Dc : hDC; Row,col: Integer; Bit : TBitmap; begin with Message do case Msg of WM_ERASEBKGND: begin DC := TWMEraseBkGnd(Message).Dc; begin Bit := TBitmap.Create; Bit.Width := Image1.Width; Bit.Height := Image1.Height; Bit.Canvas.Draw(0,0,Image1.Picture.Graphic); for Row := 0 to ClientHeight div Bit.Height do for Col := 0 to ClientWidth div Bit.Width do BitBlt(Dc, Col * Bit.Width, Row * Bit.Height, Bit.Width, Bit.Height, Bit.Canvas.Handle, 0, 0, SRCCOPY); Result := 1; Bit.Free; End; Result := 1; end; else Result := CallWindowProc(FPrevClientProc, ClientHandle, Msg, wParam, lParam); end; end; procedure TFormMain.FormClose(Sender: TObject; var Action: TCloseAction); begin SetWindowLong(ClientHandle,GWL_WNDPROC, LongInt(FPrevClientProc)); end; |
La franja horaria es GMT +2. Ahora son las 07:44:23. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi