Hi,
When executed PicShow quickly several times (sometimes more than 10 times) to show loaded image. I'm getting AV in TCustomPicShow.SetProgress line: if HandleAllocated then.
- Marko
procedure TSlideShowForm.ShowNextImage;
var
t: String;
begin
IERegisterFormats;
Timer.Enabled := False;
// if there is not any image in the list exit
if Pictures.Count = 0 then Exit;
// if PicShow is playing, stops it
if PicShow.Busy then
PicShow.Stop;
// Sets the animation style according to user sellection
if (CustomStyle.Checked) and not (Index=-1) then
begin
t:=Pictures[Index];
if ContainsText(t,'|') then
begin
if SetTransitionMode.Checked = True then
begin
Style.Value:=StrToInt(Split(t,'|',3));
Step.Value:=StrToInt(Split(t,'|',4));
Delay.Value:=StrToInt(Split(t,'|',5));
end;
ShowPause.Value:=StrToInt(Split(t,'|',6));
TimeButton.Caption:=Split(t,'|',7);
ShowPauseChange(nil);
BackGroundColor.SelectedColor:=StringToColor(Split(t,'|',8));
BackgroundColorColorChange(nil);
FrameWidth.Value:=StrToInt(Split(t,'|',9));
FrameColor.SelectedColor:=StringToColor(Split(t,'|',10));
FrameColorColorChange(nil);
end;
end;
if RandomStyle.Checked then
Style.Value := Random(High(TShowStyle))+1
else if TurnStyle.Checked then
if Style.Value < High(TShowStyle) then
Style.Value := Style.Value + 1
else
Style.Value := 1;
// Updates image name status
ShownImage := LoadedImage;
if ClearOldImage.Checked then
begin
PicShow.Clear;
PicShow.Update;
end;
StatusBar1.Panels.Items[0].Text:= 'Current Image: ' + MinimizeName(ShownImage,StatusBar1.Canvas,StatusBar1.Panels.Items[0].Width);
CurrentImage1.Caption:='Current Image: ' + ExtractFileName(ShownImage);
StatusBar1.Update;
if SetDesktopMode.Checked then ChangeWallpaper;
if (Panel7.Visible = True) and (AutoMonitorSwitch.Checked = True) then
begin
if (AutoMonitorSwitchMonitor1.ItemIndex = 0) and (AutoMonitorSwitchMonitor2.ItemIndex = 1) then
begin
if (PicShow.Picture.Height > PicShow.Picture.Width) and (GetMonitorFromWindow(handle) = 1) then GoTo1stMonitorClick(nil);
if (PicShow.Picture.Width > PicShow.Picture.Height) and (GetMonitorFromWindow(handle) = 0) then GoTo2ndMonitorClick(nil);
end;
if (AutoMonitorSwitchMonitor1.ItemIndex = 1) and (AutoMonitorSwitchMonitor2.ItemIndex = 0) then
begin
if (PicShow.Picture.Height > PicShow.Picture.Width) and (GetMonitorFromWindow(handle) = 0) then GoTo2ndMonitorClick(nil);
if (PicShow.Picture.Width > PicShow.Picture.Height) and (GetMonitorFromWindow(handle) = 1) then GoTo1stMonitorClick(nil);
end;
Application.ProcessMessages;
end;
// Begins the animation
PicShow.Execute;
IEUnRegisterFormats;
end;
PicShow.OverDraw := not ClearOldImage.Checked;
if ClearOldImage.Checked then
begin
PicShow.Clear;
PicShow.Update;
end;
Return to DELPHI AREA Projects
Users browsing this forum: No registered users and 1 guest