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!
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!