delphi 利用pngimage 单元加载png,问题
如题 delphi7 用pngimage 这个单元加载png 图片的时候 ,会出现 错误,
出问题的时候,代码直接跳到
TPngObject.DrawPartialTrans
中的
case Header.BitmapInfo.bmiHeader.biBitCount of
{R, G, B images}
24:
FOR j := 1 TO H DO
begin
{Process all the pixels in this line}
FOR i := 0 TO W - 1 DO
begin
if Stretch then i2 := trunc(i / FactorX) else i2 := i;
{Optmize when we don磘 have transparency}
if (AlphaSource[i2] <> 0) then
if (AlphaSource[i2] = 255) then
ImageData[i] := pRGBQuad(@ImageSource[i2 * 3])^ ----》 直接跳到这里,
else
with ImageData[i] do
begin
rgbRed := (255+ImageSource[2+i2*3] * AlphaSource[i2] + rgbRed *
(not AlphaSource[i2])) shr 8;
rgbGreen := (255+ImageSource[1+i2*3] * AlphaSource[i2] +
rgbGreen * (not AlphaSource[i2])) shr 8;
rgbBlue := (255+ImageSource[i2*3] * AlphaSource[i2] + rgbBlue *
(not AlphaSource[i2])) shr 8;
end;
end;
然后 往下走之后 ,图片就不能加载,
求解