Editing a graphics object with XojoScript?

I often spend a lot of time writing custom graphics code, and altering things 1 or two pixels. I was wondering if I could use XojoScript to prototype my graphics code, before I bring it into the application?

However I can’t seem to figure this out, I am getting to the point where I don’t think I can, can anyone help me?

I don’t know if you know but there’s an example imaging script in Examples>Advanced>XojoScript>Imaging, might that help?

bridging the data back and forth to Xojo Script is about the biggest issue you’ll face

plus there are no framework classes in XojoScript
no graphics class. no pictures. no access to declares. etc

I saw those mentioned in the Xojo online docs and got quite excited; but upon further inspection, was quite disappointed. It works by copying the color information from a picture into a 2D array, which is then processed in Xojo Script.

I can deal with no pictures, but no graphics means that I can’t use Xojo Script for this purpose.

Without graphics, or declares the potential to use Xojo Script for multi-core programming goes out of the window for me. It does seem like it’s an appropriate place to do it; especially with the Sandbox and using a context to exchange data. I can get by without a lot of classes if I can use declares (AppKit, CoreGraphics, CoreImage to name a few).

When designing custom controls or pixel perfect graphics, having this function would really save a lot of time, and burn on the disk. It’s not impossible, as I could write my own “Xojo” parser; but that’s a lot of work, especially as I don’t have access to a real Xojo parser.

the ONLY way you get anything close to declares is to have methods in the context object that can call into a declare
but since you cant pass graphics or pictures I’m not sure how useful that would be

I don’t know if XojoScript supports Base64, but that could be a way to pass graphics. Could be slow, though.

Added a Feedback case for this <https://xojo.com/issue/58245>

So I want to confirm a couple of things, as there’s a lot going on up there right now .

  1. My immediate task was trying to create some custom controls by drawing into a canvas. I got there in the end, but there’s a lot of time wasted by having to quit, alter, run, quit, alter, run code. Wait for the app to launch and so on. If I could just bang out some code into an application and it’ll then display on screen what that code does, I’d save a lot of time. We could also use it mockup interfaces and experiment, some workflow designs.

  2. I know how to get a memoryblock of pixel data (pretty fast with declares) that I could utilize in a XojoScript for pixel by pixel processing. To be honest, I wouldn’t use XojoScript for this. Either Core Image (and GPU) processing via GLSL (and probably MTSL later), or by using a plugin that’ll do it across multiple core. Both of these I use, because processing pixels on a single core is slow when you have 7 others idling (or 55, if you have one of the newest processors). GPU processing is undoubtably faster, but the cards have a memory limit, that I often exceed, so I have to resort to CPU processing.

  3. If XojoScript were to become the mechanism for handling multi-core processing in Xojo; I could use it for pixel-by-pixel processing, but as I have other solutions, what I’d like to use it for is other processes. I.e. Taking an image, adjusting it (simply) and then spitting out all the various blooming sizes I need, all whilst my app is doing some pretty animation to show it’s working. Yes, I know I can do this now with the helper/controller model, but man that’s such a boat load of work and hassle.

Does this make sense.

Yeah I realize, that I’m just one guys who’s trying to do things, that are way beyond the scope of what the product is good for. I really want to get back into x-plat development, but it really is hard when these limitations stand in the way.