从windows系统自带蜘蛛纸牌中提取扑克图片,发现提取到的扑克图片四个角都是白色的?请问如何解决这个问题。蜘蛛纸牌游戏中根本看不出扑克四个角是白色的,有谁帮我看看这是什么原因?

解决方案 »

  1.   

    我的测试没问题:
    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;
      

  2.   

    细细看一下,的确有.不过设
    Image1的Transparent为true
    就没有了
      

  3.   

    那不是解决问题的办法。设置Image的Transparent的话,有时候扑克本身都透明了。
      

  4.   

    我想用个笨法子暂时先解决这个问题,把Image中的扑克四个角自己上色。var
      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显示的时候图片会出现畸形!