我们做了一个酒店软件。
因我们开发是时用1024*768做的,所以对800*600不支持。
大家有什么好的建议。或有解决这类问题的经验,都来谈谈!
我现在最后的42分。
希望大家踊跃一点哈!

解决方案 »

  1.   

    窗体在不同分辨率下的大小和控件位置、变形问题:在800*600下做了一个FORM,但到640*480下一看却变了形,控件的相对位置都变了,不知道如何解决,请教诸位高手。Another_eYes (1998-11-22 22:39:29)  
    implementation
    const
      ScreenWidth: LongInt = 800; {I designed my form in 800x600 mode.}
      ScreenHeight: LongInt = 600;{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject);
    begin
      scaled := true;
      if (screen.width <> ScreenWidth) then  begin
        height := longint(height) * longint(screen.height) DIV ScreenHeight;
        width := longint(width) * longint(screen.width) DIV ScreenWidth;
        scaleBy(screen.width, ScreenWidth);
      end;
    end;下面是解决字体大小的代码:
    USES typinfo;  {Add this to your USES statement.}var
      i: integer;
    begin
      for i := componentCount - 1 downto 0 do
        with components[i] do
        begin
          if GetPropInfo(ClassInfo, 'font') <> nil  then
            font.size := (NewFormWidth DIV OldFormWidth) * font.size;
        end;
    end;下面的函数可以解决问题:
    Form:需要调整的Form,OrgWidth:开发时屏幕的宽度,OrgHeight:开发时屏幕的高度。
    注意:需要把Form的Scaled设置为True。
    procedure AdjustForm(Form: TForm; const OrgWidth, OrgHeight: integer);
    begin
      with Form do
      begin
        Width := Width * Screen.Width div OrgWidth;
        Height := Height * Screen.Height div OrgHeight;
        ScaleBy(Screen.Width, OrgWidth);
      end;
    end;
     
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      AdjustForm(Self,1280,1024);
    end;
      

  2.   

    建议把程序界面独立出来,可以用Flash做界面。
      

  3.   

    我对楼上的用Flash做界面有点感兴趣。
    可不可以说得详细点。
    比如怎么和Flash做好了界面怎么和Delphi接口。
    要不要第三方控件等等问题
      

  4.   

    DDGG(叮叮当当)说得对,FLASH,WEB页面做程序都可以,就是不要用那个什么AdjustForm函数,很难看的,FLASH我不知道怎么做,WEB控件到是用过,不过这个就要你懂HTML语言了
      

  5.   

    利用API函数:GetSystemMetrics得到屏幕值,具体怎么用请查API帮助比如你取得的是800*600,或者是640*480,则程序据API取得的值进行选择
      

  6.   

    boyfriendyu(空空) ,这样是不行的,你想想如果一个1024的放到640上会变化多大,控件位置都不在原位了,字要么都就不下,要么就看不见
      

  7.   

    在1024*768下开发的程序一调到800*600窗口与字体就变大,超出了原来设计时的布局,调了字体的类型各FORM的SCALED等,都没用,这种让FORM和其上控件都能随着分辨率调节的方法是不是只有写代码解决?假设你在800*600的分辨率下设计的form,第一步:
    inplementation
    const
    ScreenWidth: LongInt = 800; {I designed my form in 800x600 mode.}
    ScreenHeight: LongInt = 600;{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject);
    begin
    scaled := true;
    if (screen.width <> ScreenWidth) then
    begin
      height := longint(height) * longint(screen.height) div ScreenHeight;
      width := longint(width) * longint(screen.width) div ScreenWidth;
      scaleBy(screen.width, ScreenWidth);
    end;
    end;下一步,要让每个子控制的字体改变到合适的大小:
    type
    TFooClass = class(TControl); { needed to get at protected }
                                 { font property }var
    i: integer;
    begin
    for i := ControlCount - 1 downto 0 do
      TFooClass(Controls[i]).Font.Size :=
          (NewFormWidth div OldFormWidth) *
          TFooClass(Controls[i]).Font.Size;
    end; 
      

  8.   

    关注,作出的FLASH的页面与delphi怎么接口?
      

  9.   

    用shockwaveflash控件吧,delphi自带的有包安装,我用的效果不错。不过分辨率的问题同样存在!
      

  10.   

    就是用ShockwaveFlash控件,采用无标题栏的窗体,整个窗体用加载的Flash来展现。
    Flash控件是个Ocx控件,提供了一些事件和方法,可以使你的Delphi程序与加载的Flash影片进行交互。
    很多程序的安装程序都使用了Flash做界面,比如超级解霸。
    关于如何和Flash交互你可以自己研究一下罗,很简单的。
      

  11.   

    TO: lyjsharp
    用 ShockwaveFlash 控件,就可以无须考虑分辨率改变的问题了,全屏运行时,在程序里可以根据分辨率的变化动态调整 Flash 控件的大小,Flash 的内容是自动缩放的,而且是平滑缩放,效果很好。
      

  12.   

    TO: DDGG
    我试过了,不行,如果窗体开始编译时大小是800*600,然后运行起来后全屏,那么我载入的flash还是以800*600显示。其他扩大的窗口如果你设置的Shockwaveflash的底色是黑色,那就全部是黑色。
      

  13.   

    TO: lyjsharp
    可以的,是你没有处理好。
    你想想看,Flash安装自带的那个播放器可以动态缩放,我们怎么办不到。