G
gxgxfish813
Unregistered / Unconfirmed
GUEST, unregistred user!
大家好,我想做一个看图软件,先做个基本模块吧,我先放上IMAGE组件,然后什么也没有了,我想点窗体时全屏,点IMAGE时还原,功能简单吧,我目的就是为了看看全屏怎么做。不过我发现我的效果和ACD的不一样!我做的程序执行后:在原窗口变成全屏的那1秒钟里,窗体有一定的闪烁并隐约可以看到窗体背面的桌面请大家按我的源码看看就知道了。谢谢了!如果解决了我一定再送分!有一个要求,只能用一个窗体做!如果有两个窗体的话,似乎好解决多了。另外再问一下,怎么让IMAGE组件在FORM1中居中呢?代码如下了:(如果哪位兄弟能解决了请把这一小段代码写出来啊,不要说什么用SCREEN的。根本行不通的,能行我也不会写。)
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, jpeg, ExtCtrls;
type
TForm1 = class(TForm)
Image1: TImage;
procedure FormClick(Sender: TObject);
procedure Image1Click(Sender: TObject);
private
a,b:integer;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormClick(Sender: TObject);
begin
a:=form1.Width;
b:=form1.Height;
showmessage(inttostr(a));
form1.WindowState:=wsMaximized;
form1.BorderStyle:=bsNone;
end;
procedure TForm1.Image1Click(Sender: TObject);
begin
form1.WindowState:=wsNormal;
form1.BorderStyle:=bsSizeable;
form1.Width:=a;
form1.Height:=b;
showmessage(inttostr(a));
end;
end.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, jpeg, ExtCtrls;
type
TForm1 = class(TForm)
Image1: TImage;
procedure FormClick(Sender: TObject);
procedure Image1Click(Sender: TObject);
private
a,b:integer;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormClick(Sender: TObject);
begin
a:=form1.Width;
b:=form1.Height;
showmessage(inttostr(a));
form1.WindowState:=wsMaximized;
form1.BorderStyle:=bsNone;
end;
procedure TForm1.Image1Click(Sender: TObject);
begin
form1.WindowState:=wsNormal;
form1.BorderStyle:=bsSizeable;
form1.Width:=a;
form1.Height:=b;
showmessage(inttostr(a));
end;
end.