Page 1 of 1

PB to COCOA

Posted: Wed Apr 27, 2016 5:02 pm
by Wolfram
Hello,

can some one translate this to COCOA?

Code: Select all

MyImage = CreateImage(#PB_Any, 200, 100, 24, RGB(255, 255, 255))

StartDrawing(ImageOutput(MyImage))
 DrawingMode(#PB_2DDrawing_Transparent)
 DrawText(20, 40, "Hello World!", RGB(0,0,100))

StopDrawing()

Re: PB to COCOA

Posted: Wed Apr 27, 2016 5:26 pm
by wilbert
There is no exact translation.
PB does a lot of things behind the scenes.
You can draw a text onto an image using cocoa but the output will be similar to the PB Vector library.
In short, what you do with cocoa is create a NSImage object, lock focus on it, draw what you want, unlock focus.
Maybe it helps if you can explain more what you are trying to do.