全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1195
推到 Plurk!
推到 Facebook!

TColor($FFFFFF)與TColor(-1)的差別是?

答題得分者是:derekcylin
pprayer
高階會員


發表:35
回覆:185
積分:174
註冊:2002-03-13

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-04-16 09:48:45 IP:211.75.xxx.xxx 未訂閱
Delphi 6 中 定義一些顏色常數的地方,會看到這兩種使用方式,請問這兩種意義不同在哪? 另外在TColor的說明中, If the highest-order byte is zero ($00), the color obtained is the closest matching color in the system palette. If the highest-order byte is one ($01), the color obtained is the closest matching color in the currently realized palette. If the highest-order byte is two ($02), the value is matched with the nearest color in the logical palette of the current device context. 這三種方式又有什麼不同呢?
derekcylin
一般會員


發表:0
回覆:7
積分:6
註冊:2003-04-16

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-04-16 12:58:22 IP:211.21.xxx.xxx 未訂閱
TColor的宣告如下, 是用4bytes來存的值   TColor = -$7FFFFFFF-1..$7FFFFFFF; 因此TColor(-1)化成十六進位值為$FFFFFFFF 當然和$00FFFFFF不同啦.. 而它的說明很簡單啊, 就是指最高的那個byte($00FFFFFF中的00), 如果是00, 那真實顯示出來的值會依系統的調色盤(如256色)中最接近的顏色來顯示. 如果是01的話, 則依所執行的程式所用的調色盤來選最接近的. 如果是02會使用DC中的預設調色盤來找. 基本上, 只要系統調成16BIT以上的顯示模式, 而canvas使用32bit模式, 這個值是沒什麼差別的, 但是像GIF最多只有256色, 那就不同了    
引言: Delphi 6 中 定義一些顏色常數的地方,會看到這兩種使用方式,請問這兩種意義不同在哪? 另外在TColor的說明中, If the highest-order byte is zero ($00), the color obtained is the closest matching color in the system palette. If the highest-order byte is one ($01), the color obtained is the closest matching color in the currently realized palette. If the highest-order byte is two ($02), the value is matched with the nearest color in the logical palette of the current device context. 這三種方式又有什麼不同呢?
系統時間:2024-05-05 0:32:12
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!