{TChunkIDAT implementation}const
{Adam 7 interlacing values}
RowStart: array[0..6] of Integer = (0, 0, 4, 0, 2, 0, 1);
ColumnStart: array[0..6] of Integer = (0, 4, 0, 2, 0, 1, 0);
RowIncrement: array[0..6] of Integer = (8, 8, 8, 4, 4, 2, 2);
ColumnIncrement: array[0..6] of Integer = (8, 8, 4, 4, 2, 2, 1);{Copy interlaced images with 1 byte for R, G, B}
procedure TChunkIDAT.CopyInterlacedRGB8(const Pass: Byte;
Src, Dest, Trans{$IFDEF Store16bits}, Extra{$ENDIF}: pChar);
var
Col: Integer;
begin
{Get first column and enter in loop}
Col := ColumnStart[Pass];
Dest := pChar(Longint(Dest) + Col * 3);
repeat
{Copy this row}
Byte(Dest^) := fOwner.GammaTable[pByte(Longint(Src) + 2)^]; inc(Dest);
Byte(Dest^) := fOwner.GammaTable[pByte(Longint(Src) + 1)^]; inc(Dest);
Byte(Dest^) := fOwner.GammaTable[pByte(Longint(Src) )^]; inc(Dest); {Move to next column}
inc(Src, 3);
inc(Dest, ColumnIncrement[Pass] * 3 - 3);
inc(Col, ColumnIncrement[Pass]);
until Col >= ImageWidth;
end;
以上代码在delphi6可以顺利编译,但是2009编译的时候 Byte(Dest^) := fOwner.GammaTable[pByte(Longint(Src) + 2)^]; inc(Dest);报错
[DCC Error] pngimage.pas(2769): E2064 Left side cannot be assigned to
希望有人能指点一下
{Adam 7 interlacing values}
RowStart: array[0..6] of Integer = (0, 0, 4, 0, 2, 0, 1);
ColumnStart: array[0..6] of Integer = (0, 4, 0, 2, 0, 1, 0);
RowIncrement: array[0..6] of Integer = (8, 8, 8, 4, 4, 2, 2);
ColumnIncrement: array[0..6] of Integer = (8, 8, 4, 4, 2, 2, 1);{Copy interlaced images with 1 byte for R, G, B}
procedure TChunkIDAT.CopyInterlacedRGB8(const Pass: Byte;
Src, Dest, Trans{$IFDEF Store16bits}, Extra{$ENDIF}: pChar);
var
Col: Integer;
begin
{Get first column and enter in loop}
Col := ColumnStart[Pass];
Dest := pChar(Longint(Dest) + Col * 3);
repeat
{Copy this row}
Byte(Dest^) := fOwner.GammaTable[pByte(Longint(Src) + 2)^]; inc(Dest);
Byte(Dest^) := fOwner.GammaTable[pByte(Longint(Src) + 1)^]; inc(Dest);
Byte(Dest^) := fOwner.GammaTable[pByte(Longint(Src) )^]; inc(Dest); {Move to next column}
inc(Src, 3);
inc(Dest, ColumnIncrement[Pass] * 3 - 3);
inc(Col, ColumnIncrement[Pass]);
until Col >= ImageWidth;
end;
以上代码在delphi6可以顺利编译,但是2009编译的时候 Byte(Dest^) := fOwner.GammaTable[pByte(Longint(Src) + 2)^]; inc(Dest);报错
[DCC Error] pngimage.pas(2769): E2064 Left side cannot be assigned to
希望有人能指点一下
解决方案 »
- delphi中如何调用vc编写的动态链接库!
- 怎样自动加1?
- 怎么将int类型转换成chr类型???
- 如何在弹出菜单的onPopup事件中禁止菜单的弹出???
- 在ActiveX中使用WideString与String时出现的问题
- 高手关注:组建中调用dll
- Delphi MIDAS应用 版的“MIDAS”是什么意思啊??
- *****如何实现动态配置remote data module中adoconnection的connectstring*************************
- 在Delphi中如何提取指定帧的图像??
- 靠,我大专毕业就没有人瞧的起吗?
- 关于颜色表
- 如何在保存数据的时候,依然能够操作界面?
Src, Dest, Trans{$IFDEF Store16bits}, Extra{$ENDIF}: pChar);
改成:
procedure TChunkIDAT.CopyInterlacedRGB8(const Pass: Byte;
Src, Dest, Trans{$IFDEF Store16bits}, Extra{$ENDIF}: PByte);
Src, Dest, Trans{$IFDEF Store16bits}, Extra{$ENDIF}: pChar);
改成:
procedure TChunkIDAT.CopyInterlacedRGB8(const Pass: Byte;
Src, Dest, Trans{$IFDEF Store16bits}, Extra{$ENDIF}: PByte);
Dest := pChar(Longint(Dest) + Col * 3);
[DCC Error] pngimage.pas(2766): E2010 Incompatible types: 'PByte' and 'PWideChar'
应该是类型不对,我不太熟悉delphi,一直用BCB的。怎么才能赋值呢?