Effective Thumbnail Image Management for Python?

What is the best choice for a Python GUI application to display a large number of thumbnails, for example. 10,000 or more? For performance reasons, such thumbnail management should support virtual elements, that is, request an application only for those thumbnails that are currently visible to the user.

+3
source share
3 answers

In wxPython, you can use wxGrid to do this, since it supports virtual mode and custom cell rendering.

This is the minimum interface you should implement for the wxGrid data provider:

class GridData(wx.grid.PyGridTableBase):
    def GetColLabelValue(self, col):
        pass

    def GetNumberRows(self):
        pass

    def GetNumberCols(self):
        pass

    def IsEmptyCell(self, row, col):
        pass

    def GetValue(self, row, col):
        pass

- , wxGrid:

class CellRenderer(wx.grid.PyGridCellRenderer):
    def Draw(self, grid, attr, dc, rect, row, col, isSelected):
        pass

, wxPython docs demos, Grid_MegaExample.

+2

Just for completeness: there is thumbnailCtrl written in / for wxPython, which can be a good starting point.

+1
source

Source: https://habr.com/ru/post/1698436/


All Articles