Q&A

  • Mdi Main Form에 배경그림(jpg,gif)를 넣는방법좀 알려주세요.
Mdi Main Form배경화면에 Image를 넣고 싶은데, 안되네요.

방법을 알고계신분을 mail이나 답변을 좀 부탁 드립니다.

1  COMMENTS
  • Profile
    전한민 2000.10.09 20:14
    Good wrote:

    > Mdi Main Form배경화면에 Image를 넣고 싶은데, 안되네요.

    > 방법을 알고계신분을 mail이나 답변을 좀 부탁 드립니다.





    private

    { Private declarations }

    FClientInstance,

    FPrevClientProc : TFarProc;

    procedure ClientWndProc( VAR Message :TMessage );





    procedure TForm1.FormCreate(Sender: TObject);

    begin

    FClientInstance := MakeObjectInstance( ClientWndProc );

    FPrevClientProc := Pointer( GetWindowLong( ClientHandle, GWL_WNDPROC ));

    SetWindowLong( ClientHandle, GWL_WNDPROC, LongInt( FClientInstance ));

    //Main 화면 Image

    Image1.Picture.LoadFromFile('Image File이 있는 Path');

    Image1.Stretch := True;

    end;



    procedure TForm1.ClientWndProc( VAR Message :TMessage );

    var

    MyDC :hDC;

    begin

    with Message do

    case Msg of

    WM_ERASEBKGND:

    begin

    MyDC := TWMEraseBkGnd( Message ).DC;

    //Only One...

    BitBlt( MyDC, 0, 0, 793, 554,

    Image1.Picture.Bitmap.Canvas.Handle, 0, 0, SRCCOPY );

    Result := 1;

    end;

    else

    Result := CallWindowProc( FPrevClientProc, ClientHandle, Msg, wParam,

    lParam );

    end;

    end;



    이런 식으로 하면 됩니다....