我是Java的新手,我已经学会了如何在jLabel
中添加netbeans
中的图像作为图标type
WINHTTP_PROXY_INFO = record
AccessType: Cardinal;
Proxy: Cardinal;
ProxyBypass: Cardinal;
end;
function WinHttpGetDefaultProxyConfiguration(var ProxyInfo: WINHTTP_PROXY_INFO): Boolean;
external 'WinHttpGetDefaultProxyConfiguration@winhttp.dll stdcall';
function StrCpyN(S1: string; S2: Cardinal; Max: Cardinal): Cardinal;
external 'StrCpyNW@shlwapi.dll stdcall';
function GetProxy: string;
var
ProxyInfo: WINHTTP_PROXY_INFO;
begin
if WinHttpGetDefaultProxyConfiguration(ProxyInfo) then
begin
SetLength(Result, 1024);
StrCpyN(Result, ProxyInfo.Proxy, Length(Result) - 1);
Result := Trim(Result);
Log('Retrieved proxy information: ' + Result);
end
else
begin
Log('Cannot retrieve proxy information');
end;
end;
,但图像以臭名昭着的方式行事,因为它变得太大了这种方式只能看到它的一部分。
我尝试了各种各样的方法,但我没有解决,大多数答案通过编码来解释,这是我不熟悉的方式。
因此,我谦虚地寻求帮助,了解如何使该图像适合小型jLabel,或者是否有其他方法可以实现此目的。 (这些图像适用于具有图像复选框和名称的计算机投票系统。)