'//取各顏色分量
public
function getredvalue(color as
long) as
integer
'取得紅色值
getredvalue = color and
endfunction
public
function getgreenvalue(color as
long) as
integer
'取得綠色值
getgreenvalue = (color and 65280) / 256
endfunction
public
function getbluevalue(color as
long) as
integer
'取得藍色值
getbluevalue = (color and &hff0000) / 65536
endfunction
'//將rgb轉化為html顏色.
public
function gethexcolor(red as
integer, green as
integer, blue as
integer) as
string
'將rgb顏色轉換為html顏色
dim strred as
string, strgreen as
string, strblue as
string
strred = hex(red)
strgreen = hex(green)
strblue = hex(blue)
if red <= 16 then strred = "0" & strred
if green <= 16 then strgreen = "0" & strgreen
if blue <= 16 then strblue = "0" & strblue
gethexcolor = strred & strgreen & strblue
endfunction
MFC 各控制項背景顏色設定
1 新增onctlcolor訊息響應函式 hbrush cdmpydlg onctlcolor cdc pdc,cwnd pwnd,uint nctlcolor case ctlcolor edit 2 wm ctlcolor訊息對應的函式為onctlcolor,onctlcolor函式的原型為 a...
VB 取網頁原始碼
private declare function urldownloadtofile lib urlmon alias urldownloadtofilea byval pcaller as long,byval szurl as string,byval szfilename as string,...
python陣列各元素取整
對於python陣列來說,可以有三種格式 numpy包裡的array格式,例如,建立乙個三行而列的陣列 a np.array 1,2 3,4 5,6 matrix格式,例如 b np.matrix 1,2 3,4 5,6 利用list組成的陣列,例如 c 1,2 3,4 5,6 可以看到,array...