def METHOD_NAME(self, path, prefix, format):
    """Generate image files
    :param path: path to directory
    :param prefix: file prefix
    :param format: index of image file format
    """
    size = self.mapWindow.GetClientSize()
    toolWin = self.mapWindow.GetToolWin()
    formatter = ":04.0f"
    n = len(self.animationList)
    if n < 10:
        formatter = ":01.0f"
    elif n < 100:
        formatter = ":02.0f"
    elif n < 1000:
        formatter = ":03.0f"
    self.currentFrame = 0
    self.mode = "save"
    for params in self.animationList:
        if not self.stopSaving:
            self.UpdateView(params)
            number = ("{frame" + formatter + "}").format(frame=self.currentFrame)
            filename = "{prefix}_{number}.{ext}".format(
                prefix=prefix, number=number, ext=self.formats[format]
            )
            filepath = os.path.join(path, filename)
            self.mapWindow.SaveToFile(
                FileName=filepath,
                FileType=self.formats[format],
                width=size[0],
                height=size[1],
            )
            self.currentFrame += 1
            wx.GetApp().Yield()
            toolWin.UpdateFrameIndex(index=self.currentFrame, goToFrame=False)
        else:
            self.stopSaving = False
            break
    self.animationSaved = True
    self.PostFinishedEvent()