关于两个小问题(Tcolor转换,WebBrowser控件自动滚屏)(200分)

H

heming

Unregistered / Unconfirmed
GUEST, unregistred user!
1、Tcolor如何转换为网页所使用的颜色,我使用IntToHex(ColorToRGB(Panel1.color))
结果和网页使用的颜色不一致。
2、如何使得WebBrowser控件自动滚屏(自动移动滚动条到最下面)

谢谢!急用。。。
 
IntToHex(ColorToRGB(Panel1.color),6)
 
还是绝大多数颜色不一致
 
IHTMLWindow2::scrollBy Method

-----------------------------------------------------------------------------
Causes the window to scroll relative to the current scrolled position by the
specified x- and y-pixel offset.

Syntax

HRESULT scrollBy( long x,
long y
);
Parameters

x
[in] long that specifies the horizontal scroll offset, in pixels. Positive
values scroll the window right, and negative values scroll it left.
y
[in] long that specifies the vertical scroll offset, in pixels.
Positive values scroll the window down, and negative values scroll it up.
Return Value

Returns S_OK if successful, or an error value otherwise.

See Also

IHTMLWindow2::scrollTo

------------------------------------------------------------------------------
© 2002 Microsoft Corporation. All rights reserved.
 
使用 WebBrowser1.ScrollBy(0,1) 就把 WebBrowser1整体移动了,而不是自动滚动滚动条。
 
怎么?没有人能给出满意的答案吗?
 
try below functions to convert Hex to TColor and TColor to Hex.

function TColorToHex(Color : TColor) : string;
begin
Result :=
IntToHex(GetRValue(Color), 2) +
IntToHex(GetGValue(Color), 2) +
IntToHex(GetBValue(Color), 2);
end;

function HexToTColor(sColor : string) : TColor;
begin
Result :=
RGB(
StrToInt('$'+Copy(sColor, 1, 2)),
StrToInt('$'+Copy(sColor, 3, 2)),
StrToInt('$'+Copy(sColor, 5, 2))
);
end;
 
谢谢cony:颜色转换的问题已经解决!
不过第二个问题还没有好的办法,先接受答案了。
 
CathyEagle 50
cony 150
 
顶部