Hey there,
I’m in the process of building a little thing with a PiSound/Teensy and an OLED connected to it, but would like to do some prototyping first (testing different screen resolutions/sizes). Later on, it would be super-cool to re-use the GUI stuff I wrote in some way to the display via OSC. For now, requirements would be: Writing StaticText and drawing lines to a Qt Window and being able to change the DPI.
How would I go about doing that? I already tried to use Image.drawStringAtPoint
, rendering single images to a QtWindow. Somehow, drawStringAtPoint doesn’t seem to work, I get this error:
Summary
ERROR: Primitive '_QImage_NewEmpty' failed.
Wrong type.
RECEIVER:
Instance of Image { (0x11ba683f8, gc=34, fmt=00, flg=00, set=03)
instance variables [5]
dataptr : nil
finalizer : nil
name : nil
url : nil
scalesWhenResized : false
}
CALL STACK:
MethodError:reportError
arg this = <instance of PrimitiveFailedError>
Nil:handleError
arg this = nil
arg error = <instance of PrimitiveFailedError>
Thread:handleError
arg this = <instance of Thread>
arg error = <instance of PrimitiveFailedError>
Object:throw
arg this = <instance of PrimitiveFailedError>
Object:primitiveFailed
arg this = <instance of Image>
Meta_Image:new
arg this = <instance of Meta_Image>
arg multiple = <instance of Point>
arg height = nil
var ret = nil
< closed FunctionDef >
var width = 77.0
var height = 13.0
var tgHeight = nil
var ratio = 0.16883116883117
var str = "I Love Pixels"
var font = <instance of Font>
var color = <instance of Color>
var strb = <instance of Rect>
var targetWidth = 400
var shadowColor = <instance of Color>
var run = true
Interpreter:interpretPrintCmdLine
arg this = <instance of Interpreter>
var res = nil
var func = <instance of Function>
var code = "(
var width, height, tgH..."
var doc = nil
var ideClass = <instance of Meta_ScIDE>
Process:interpretPrintCmdLine
arg this = <instance of Main>
^^ The preceding error dump is for ERROR: Primitive '_QImage_NewEmpty' failed.
Wrong type.
RECEIVER: an Image
trying to run the example from the Image.drawStringAtPoint help file.
I’m running SC 3.11.2 on macOS 10.14.6
Any help would be greatly appreciated! :~)
All the best,
schmolmo