procedure Effect119(Display, Image: TBitmap; W, H, X, Y, Progress: Integer);
var
dstPixel, srcPixel: PRGBQuad;
Weight: Integer;
I: Integer;
begin
srcPixel := Image.ScanLine[H - 1];
dstPixel := Display.ScanLine[H - 1];
Weight := MulDiv(256, Progress, 100);
for I := (W * H) - 1 downto 0 do
begin
with dstPixel^ do
begin
Inc(rgbRed, (Weight * (srcPixel^.rgbRed - rgbRed)) shr 8); <-------------- Crashes here
Inc(rgbGreen, (Weight * (srcPixel^.rgbGreen - rgbGreen)) shr 8);
Inc(rgbBlue, (Weight * (srcPixel^.rgbBlue - rgbBlue)) shr 8);
end;
Inc(srcPixel);
Inc(dstPixel);
end;
end;
procedure TMainFRM.TransTimerTimer(Sender: TObject);
const
Step = 2;
begin
// advance transitions
for I := 0 to ControlCount - 1 do
if Controls[I] is TDBPicShow then
with TDBPicShow(Controls[I]) do Progress := Progress + Step;
// stop timer if transitions are done
TransTimer.Enabled := (dbPicShow1.Progress < 100);
end;
procedure TMainFRM.NextImageSet;
var
I: Integer;
begin
// stop Transition timer
TransTimer.Enabled := False;
// stop all DBPicShow instances
for I := 0 to ControlCount - 1 do
if Controls[I] is TDBPicShow then
TDBPicShow(Controls[I]).Stop;
// advance to the next record
adodb1.Next;
adodb2.Next;
adodb3.Next;
// start all DBPicShow instances
for I := 0 to ControlCount - 1 do
if Controls[I] is TDBPicShow then
TDBPicShow(Controls[I]).Execute;
// start Transition timer
TransTimer.Enabled := False;
end;
Return to DELPHI AREA Projects
Users browsing this forum: No registered users and 3 guests