From: "Earl F. Glynn" Subject: Scanline code fragment that causes Internal Error C1127 (D4) and C1141 (D5) Date: 22 Feb 2000 00:00:00 GMT Message-ID: <88uiu0$5a83@bornews.borland.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Organization: efg's Computer Lab X-MSMail-Priority: Normal Reply-To: "Earl F. Glynn" Newsgroups: borland.public.delphi.graphics Would someone please verify this internal error in D4/D5 on your machine? (This code fragment doesn't do anything useful at execution time.) Create a new project and put the code below in the Button1Click event and just see if the project will compile successfully. unit ScreenFixLogo; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.Button1Click(Sender: TObject); TYPE TRGBTripleArray = ARRAY[WORD] OF TRGBTriple; pRGBTripleArray = ^TRGBTripleArray; VAR BitmapIn : TBitmap; BitmapOut: TBitmap; i,j : INTEGER; RowIn : pRGBTripleArray; RowOut : pRGBTripleArray; begin BitmapIn := TBitmap.Create; TRY BitmapIn.LoadFromFile('global_logo.bmp'); BitmapOut := TBitmap.Create; TRY BitmapOut.Width := BitmapIn.Width; BitmapOut.Height := BitmapIn.Height; BitmapOut.PixelFormat := pf24bit; FOR j := 0 TO BitmapIn.Height - 1 DO BEGIN RowIn := BitmapIn.Scanline[j]; RowOut := BitmapOut.Scanline[j]; FOR i := 0 TO BitmapIn.Width-1 DO BEGIN CASE RowIn[i].rgbtRed OF 0: BEGIN RowOut[i].rgbtRed := 255; RowOut[i].rgbtGreen := 255; RowOut[i].rgbtBlue := 255; END; 255: RowOut[i] := RowIn[i]; ELSE RowOut[i].rgbtRed := 0; RowOut[i].rgbtGreen := 0; RowOut[i].rgbtBlue := 0; END END END FINALLY BItmapOut.Free END FINALLY BitmapIn.Free END end; end. What's a bit wierd is that commenting out any line inside the CASE statement makes the internal error go away! The code compiles without error in D3, but if I remember correctly, the assignment in the case "255" above doesn't always work before D 4.02. I'll report this to Borland as a bug. -- efg Earl F. Glynn Overland Park, KS USA efg's Computer Lab: http://www.efg2.com/Lab