SavePicture1Click method

Applies to
TForm2

Declaration
procedure SavePicture1Click(Sender: TObject);

Implementation

procedure TForm2.SavePicture1Click(Sender: TObject);
var p1,s1:String;
begin try
if Sender<>nil then play_snd(1);
if assigned(_imgElement) then begin
   s1:=_imgElement.href;
   StrReplace(s1,'//','',[rfIgnoreCase, rfReplaceAll]);
   StrReplace(s1,'/','\',[rfIgnoreCase, rfReplaceAll]);
   picture_save1.FileName := ExtractFileName(s1);
   p1:=ExtractFileExt(picture_save1.FileName);
   StrReplace(p1,'.','',[rfIgnoreCase, rfReplaceAll]);
   picture_save1.Filter := Uppercase(p1)+' Image File (*.'+p1+')|*.'+p1;
   picture_save1.DefaultExt :=p1;
   picture_save1.InitialDir := my_wiki_dir;
   if picture_save1.Execute then begin
      if not DownloadFile(_imgElement.href,picture_save1.filename) then
         MsgBox(Application.Title,'Unable to save selected image file "'+ExtractFileName(picture_save1.filename)+'" !',0,3);
   end;
end;
except
on E : Exception do begin
   _log_entry_error(E.ClassName,E.Message,'A50000');
   Screen.Cursor :=crDefault;
end;
end;End;


HTML generated by Time2HELP
http://www.time2help.com