delphi程式適應螢幕解析度

2021-08-30 00:21:03 字數 552 閱讀 4990

delphi程式適應螢幕解析度

先在表單單元的inte***ce部分定義兩個常量,表示設計時的螢幕的寬度和高度(以畫素為單位)。在表單的create事件中先判斷當前解析度是否與設計解析度相同,如果不同,呼叫表單的scale過程重新能調整表單中控制項的寬度

和高度。

const

orignwidth=800;

orignheight=600;

procedure tform1.formcreate(sender:tobject);

begin

scaled:=true;

if (screen.width<>orignwidth) then

begin

height:=longint(height)*longint(screen.height)divorignheight;

width:=longint(width)*longint(screen.width)divorignwidth;

scaleby(screen.width,orignwidth);

end;

end;

android程式介面自動適應螢幕解析度例子

為不同解析度的手機建立介面 1,首先進入res 資料夾下。2,建立乙個名為 layout 1024x768 資料夾,其中1024x768 是螢幕解析度的大小,值得注意的是解析度中大的數字必須寫到前面,否 則會產生語法錯誤。如layout 768x1024 的寫法是錯誤的。3,編寫main.xml 4...

螢幕解析度

xga extended graphics array 擴充套件影象陣列 s super 超過 x extended 擴充套件 u ultra 終極 第乙個q quarter 四分之一 最後乙個q quantum 量化 h half 一半 w wide 寬 example vga 640 480 q...

螢幕解析度

1.1920 1080 1080p 1920x1080 1080p 就是俗稱的 full hd sony 超拼的 以前只有在電視上看得到 電腦用 1920x1200 的多 不過開始出現採用 1080p 面板的膝上型電腦,像第二代的 acer 寶石機,標榜可以 讓畫面塞滿螢幕,不留黑邊 主流顯示器各尺...