Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2002.12.09;
Скачать: [xml.tar.bz2];

Вниз

MDI форма   Найти похожие ветки 

 
Term   (2002-11-27 11:26) [0]

Подскажите как поместить image на mdi форму


 
Игорь Шевченко   (2002-11-27 12:11) [1]

К примеру так:

unit main;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ActnList, Menus, jpeg, ExtCtrls, ComCtrls;

type
TForm1 = class(TForm)
ActionList1: TActionList;
MainMenu1: TMainMenu;
actClose: TAction;
StatusBar1: TStatusBar;
N1: TMenuItem;
N2: TMenuItem;
Image1: TImage;
actTest: TAction;
N3: TMenuItem;
actTest1: TMenuItem;
procedure actCloseExecute(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure actTestExecute(Sender: TObject);
private
{ Private declarations }
FClientInstance : TFarProc;
FPrevClientProc : TFarProc;
procedure ClientWndProc(var Message: TMessage);
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation
uses Test;

{$R *.DFM}

procedure TForm1.ClientWndProc(var Message: TMessage);
var
Dc : hDC;
Row : Integer;
Col : Integer;
begin
if (Image1.Picture.Width = 0) OR (Image1.Picture.Height = 0) then begin
with Message do
Result := CallWindowProc(FPrevClientProc,
ClientHandle,
Msg,
wParam,
lParam);
Exit;
end else
with Message do
case Msg of
WM_ERASEBKGND:
begin
Dc := TWMEraseBkGnd(Message).Dc;
for Row := 0 to ClientHeight div Image1.Picture.Height do
for Col := 0 to ClientWidth div Image1.Picture.Width do
BitBlt(Dc,
Col * Image1.Picture.Width,
Row * Image1.Picture.Height,
Image1.Picture.Width,
Image1.Picture.Height,
Image1.Picture.Bitmap.Canvas.Handle,
0,0,SRCCOPY);
Result := 1;
end;
else
Result := CallWindowProc(FPrevClientProc,
ClientHandle,
Msg,
wParam,
lParam);
end;
end;

procedure TForm1.actCloseExecute(Sender: TObject);
begin
Close();
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
FClientInstance := MakeObjectInstance(ClientWndProc);
FPrevClientProc := Pointer(GetWindowLong(ClientHandle,
GWL_WNDPROC));
SetWindowLong(ClientHandle,
GWL_WNDPROC, LongInt(FClientInstance));
end;

procedure TForm1.actTestExecute(Sender: TObject);
begin
with TfrmTest.Create(Application) do
Show();
end;

end.


 
Term   (2002-11-28 11:00) [2]

спасибо
попробую



Страницы: 1 вся ветка

Форум: "Основная";
Текущий архив: 2002.12.09;
Скачать: [xml.tar.bz2];

Наверх




Память: 0.44 MB
Время: 0.009 c
4-28347
TankMan
2002-10-28 09:58
2002.12.09
Как описывать реакцию на события динамически создаваемых объектов


3-27900
lva
2002-11-21 16:08
2002.12.09
Проблема с BDE, а точнее с отображением дробной части


7-28312
gluka
2002-10-05 01:32
2002.12.09
Service & Desktop


1-28124
Ser_Kham1
2002-11-28 14:53
2002.12.09
Crypto


4-28360
SlashSW
2002-10-28 21:59
2002.12.09
Анимированная иконка в tray





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский