一个奇怪的语法问题(100分)

  • 主题发起人 主题发起人 cuiax
  • 开始时间 开始时间
C

cuiax

Unregistered / Unconfirmed
GUEST, unregistred user!
// Inverting a pf1bit Bitmap
FOR j := 0 TO Bitmap.Height-1 DO
BEGIN
RowOut := pByteArray(bmpDes.Scanline[j]);
RowIn := pByteArray(bmpSrc.Scanline[j]);
FOR i := 0 TO (bmpDes.Width DIV BitsPerPixel)-1 DO
BEGIN
RowOut := NOT RowIn
END
END;

-----------------------------------------------------------------
Because I use C++ Builder, So I try to translate to C++ Builder
Here are my code.
-----------------------------------------------------------------
TByteArray *DesRow, *SrcRow;
for (int y = 0; y < Height; y++) {
DesRow = (TByteArray *)bmpDes->ScanLine[y];
SrcRow = (TByteArray *)bmpSrc->ScanLine[y];
for (int x = 0; x < Width; x++) {
DesRow[x]= !SrcRow[x];
}
}
-----------------------------------------------------------------

But it can't run
C++ Builder Tell me "Lvalue required" at "DesRow[x]= !SrcRow[x];"
Please, help me!
 
改成:(*DesRow)[x]= !(*SrcRow)[x]; 行不行?
 
谢谢,我找到了,是PBYTEARRAY XXXX;不过与我的设想还是 有一段距离
但是分数还是 分了吧
 

Similar threads

后退
顶部