What's the fastest way to set the pixels of a Picture object?

The code was from Alain Bailleul, but I’ve used it many times :wink:

OpenGL Shaders are orders faster, able to draw 20 stacked 512x512 images with windowing and perspective in realtime. Render event time is around 100-400 microseconds but I’m not sure that’s the actual draw time, the gpu may be doing it later. Still, the interaction is perfectly fluid.

Here’s the project stackeddcm.zip.

To try this out you need to get specific data here
http://idoimaging.com/wiki/tiki-index.php?page=Sample+Data
Either of these downloads for Patient 1030: Knee MR will work, the LEE ones.
1030_knee_mr_02_lee.zip
1030_knee_mr_03_lee.zip

And you’ll need to modify the “dim f As FolderItem =” line in GLStackedWindow.display.Open to point to those files on your system.

Run and mouse drag to move the camera, scroll up/down to zoom. The stacking only works when viewed from one side, if you go around the back they disappear.

Uses declares for the shaders which may or may not work on Windows, untested. Doesn’t work on Linux because there’s no library string. I thought I had that in there but oh well. If you know the linux library name add it to the kLibOpenGL constants and this may work.

Also it’s 32bit only because at least one place assumes Ptrs are 4 bytes.