Cabbage Logo
Back to Cabbage Site

Displaying an image created with 'imagecreate'

I’ve been looking at the image widget for the past couple of days, and I was wondering if there is a way to display an image that is created using the CSound opcode ‘imagecreate’, or does it only display images from disk? I was trying to figure this out by looking at the code, but I don’t understand it quite yet.

Effectively, I’m trying to render a thumbnail version of fractal data that I’m working with.


Good question. Let me check…

Yes. You can create the image, write it to disk, and then load it to the image widget in Cabbage. Here’s an example. Btw, the image widgets are a little broken on Windows. So if you want to port to Windows you might be out of luck.

imageCreate.csd (1.3 KB)

Huh, that’s what I was thinking. But what I was hoping for would to be able to take the value returned from ‘imagecreate’, and pass that to the image widget for display. I was thinking that I could create a rendering instrument that runs so many iterations of the fractal equation per k-cycle, and then updates the image associated with the widget. But, I’ll go with the static image to disk for now!