hmaarrfk
hmaarrfk

Reputation: 437

Multiple images in same view

Is there a way to show multiple images on the same view with different offsets?

The _build_vertex_data in vispy/visuals/image.py doesn't seem to take any offsets.

For example, I would like to have 3 images side by side, allowing me to zoom in and out of them as a group.

Upvotes: 0

Views: 195

Answers (1)

kne42
kne42

Reputation: 136

You can achieve this by applying a transformation to the visual.

from vispy import scene
from vispy.visuals.transforms import STTransform

...

image1 = scene.visuals.Image(...)

image2 = scene.visuals.Image(...)

# sets y-axis offset to 42
image2.transform = STTransform(translate=[42])
#                = STTransform(translate=[42, 0, 0, 0],
#                              scale=[0, 0, 0, 0])

...

Upvotes: 1

Related Questions