I have a folder with a lot of thumbnails.
I am displaying the thumbnails in a UA with a vertical scrollbar.
Vertical scrolling is all handled by cinema 4d, I have added no code for scrolling.
So far so good. For a small number of thumbnails it is working ok, but for more thumbnails the performance is very bad!
I noticed, after adding some debug statements, that the bad performance seems to be outside DrawMsg().
DrawMsg() itself seems fast enough, but before anything happens on the screen it takes some time.
Also when moving the vertical slider, DrawMsg() is called more than once.
What can I do to increase performance?
Build my own scrolling functionality?
Here the basics of DrawMsg()
def DrawMsg(self, x1, y1, x2, y2, msg):
self.OffScreenOn()
self.SetClippingRegion(x1,y1,x2,y2)
self.DrawSetPen(c4d.Vector(.4))
self.DrawSetTextCol(c4d.Vector(1,1,1), c4d.Vector(.4)) #GeUserArea.DrawSetTextCol(fg, bg)
self.DrawRectangle(x1, y1, x2, y2) # Clear UA by Draws the UA rectangle area
# display thumbnails
...
for rows in range(0, self.nrRows):
for colums in range(0, self.nrColumns):
....
self.DrawBitmap(self.bmp, x1, y1, self.thumbnailSize, self.thumbnailSize, 0, 0, 500, 500, c4d.BMP_NORMAL)
return
Example of the UA,