creating CG types in beta?
In trying to grab screenshots from a video, I believe I need to define
ObjCClass('CGImage')doesnt find that class.
Looking at the headers, CGImage is just a struct, so I think i can create that type as a structure, however I still need to pass a function pointer to CGImageDestroy, which also doesnt seem to be recognized by the cdll.
I am sure I am missing something incredibly basic....
CGImageRefas a pointer (
c_void_p), and don't worry about the internal structure. It's an "opaque" type, and you'd never access its structure directly in C code either. The CoreGraphics framework (where
CGImageRefis defined) is just plain C, not Objective-C, so you usually manipulate its "objects" using functions, e.g.
It's usually easier to deal with
CGImageRefif you wrap it in a
+imageWithCGImage:(or some variation, like
Thanks, i ended up figuring that part out, but wasnt sure because i kept getting crashes. turns out NSError was throwing me off, because i had to pass a pointer to an NSError object, rather than the object itself... or, better yet, None.