TIEColorCurve.UpdateHistograms produces an exception in some projects... not all, but I can not determine why?
procedure TForm1.Curves1Click(Sender: TObject);
begin
if Assigned(PageControl1.ActivePage) then
begin
ImageEnView := TImageEnView(PageControl1.ActivePage.Controls[0]);
if Assigned(ImageEnView) then
begin
FormCurves := TFormCurves.Create(Self);
try
FormCurves.IEColorCurve1.AssignSource(ImageEnView.IEBitmap);
if FormCurves.ShowModal = mrOK then
FormCurves.IEColorCurve1.ApplyCurve(ImageEnView.IEBitmap); << Exception in TIEColorCurve.UpdateHistograms
ImageEnView.Update();
finally
FormCurves.Free;
end;
end;
end;
end;
procedure TIEColorCurve.UpdateHistograms();
var
bmp: TIEBitmap;
iRow: PCurvesRGBArray;
X, Y, RFill: Integer;
iRGB: TRGB;
iR, iG, iB, iZ: Byte;
begin
if fBitmap.IsEmpty then
Exit;
if fPreviewValid then
bmp := fPreviewBitmap
else
bmp := fBitmap;
for Y := 0 to 3 do
begin
fHistogramsMax[Y] := 0;
for X := 0 to 255 do
fHistograms[Y, X] := 0;
end;
iRow := PCurvesRGBArray( bmp.Scanline[0]);
RFill := Integer( bmp.Scanline[1]) - Integer(iRow);
for Y := 0 to bmp.Height - 1 do
begin
for X := 0 to bmp.Width - 1 do
begin
iRGB := iRow[X]; << Exception
Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development