我的测试没问题: procedure TForm1.Button1Click(Sender: TObject); var m_hIns,m_hRsrc:THANDLE; begin m_hIns:=LoadLibraryEx('c:\windows\system32\spider.exe',0,LOAD_LIBRARY_AS_DATAFILE); if m_hIns=0 then begin ShowMessage('error1'); exit; end; Image1.Picture.Bitmap.LoadFromResourceName(m_hIns, 'CARD25');end;
procedure TForm1.Button1Click(Sender: TObject);
var
m_hIns,m_hRsrc:THANDLE;
begin
m_hIns:=LoadLibraryEx('c:\windows\system32\spider.exe',0,LOAD_LIBRARY_AS_DATAFILE);
if m_hIns=0 then
begin
ShowMessage('error1');
exit;
end;
Image1.Picture.Bitmap.LoadFromResourceName(m_hIns, 'CARD25');end;
Image1的Transparent为true
就没有了
tmpColor: TColor;
begin
tmpColor := clGreen;
with Image1.Picture.Bitmap.Canvas do
begin
Pixels[0, 0] := tmpColor;
Pixels[0, 1] := tmpColor;
Pixels[1, 0] := tmpColor; Pixels[Image1.Picture.Bitmap.Width - 1, 0] := tmpColor;
Pixels[Image1.Picture.Bitmap.Width - 1, 1] := tmpColor;
Pixels[Image1.Picture.Bitmap.Width - 2, 0] := tmpColor; Pixels[0, Image1.Picture.Bitmap.Height - 1] := tmpColor;
Pixels[1, Image1.Picture.Bitmap.Height - 1] := tmpColor;
Pixels[0, Image1.Picture.Bitmap.Height - 2] := tmpColor; Pixels[Image1.Picture.Bitmap.Width - 1, Image1.Picture.Bitmap.Height - 1] := tmpColor;
Pixels[Image1.Picture.Bitmap.Width - 1, Image1.Picture.Bitmap.Height - 2] := tmpColor;
Pixels[Image1.Picture.Bitmap.Width - 2, Image1.Picture.Bitmap.Height - 1] := tmpColor;
end;
end;但是结果发现上不了clGreen这个颜色。不知道为什么?另外,梅花A用Image显示的时候图片会出现畸形!