procedure TSkinMediaTimer.UpdateDis(WinHandle: HWND;
DC: HDC; ViewTime: Integer);
var
DisplayMin: Integer;
DisplaySec: Integer;
DisplayMs: Integer;
NumImg,
NumImgW,
NumImgH: cardinal;
Graphics: Cardinal;
begin
DisplayMs := ViewTime
mod 1000
div 10;
DisplaySec := ViewTime
div 1000;
DisplayMin := DisplaySec
div 60;
DisplaySec := DisplaySec
mod 60;
DisplayMin := DisplayMin
mod 60;
NumImg := SkinEngine.GetProperty(WinHandle, NUMBER_IMAGE);
if GdipCreateFromHDC(
DC, Graphics) = 0
then
begin
SkinEngine.GetImageSize(NumImg, NumImgW, NumImgH);
case DisplayMin
of
9:
begin
NumberLed(Graphics, NumImgH, 1, StrToInt(Copy(IntToStr(DisplayMin), 1, 1)));
NumberLed(Graphics, NumImgH, 2, StrToInt(Copy(IntToStr(DisplayMin), 2, 1)));
end;
0:
begin
NumberLed(Graphics, NumImgH, 1, 0);
NumberLed(Graphics, NumImgH, 2, 0);
end
else
begin
NumberLed(Graphics, NumImgH, 1, 0);
NumberLed(Graphics, NumImgH, 2, StrToInt(Copy(IntToStr(DisplayMin), 1, 1)));
end;
end;
case DisplaySec
of
9:
begin
NumberLed(Graphics, NumImgH, 3, StrToInt(Copy(IntToStr(DisplaySec), 1, 1)));
NumberLed(Graphics, NumImgH, 4, StrToInt(Copy(IntToStr(DisplaySec), 2, 1)));
end;
0:
begin
NumberLed(Graphics, NumImgH, 3, 0);
NumberLed(Graphics, NumImgH, 4, 0);
end;
else
begin
NumberLed(Graphics, NumImgH, 3, 0);
NumberLed(Graphics, NumImgH, 4, StrToInt(Copy(IntToStr(DisplaySec), 1, 1)));
end;
end;
case DisplayMs
of
9:
begin
NumberLed(Graphics, NumImgH, 5, StrToInt(Copy(IntToStr(DisplayMs), 1, 1)));
NumberLed(Graphics, NumImgH, 6, StrToInt(Copy(IntToStr(DisplayMs), 2, 1)));
end;
0:
begin
NumberLed(Graphics, NumImgH, 5, 0);
NumberLed(Graphics, NumImgH, 6, 0);
end
else
begin
NumberLed(Graphics, NumImgH, 5, 0);
NumberLed(Graphics, NumImgH, 6, StrToInt(Copy(IntToStr(DisplayMs), 1, 1)));
end;
end;
GdipDeleteGraphics(Graphics);
end;
end;