Re: Converting a CFImageRef to a NSImage
Re: Converting a CFImageRef to a NSImage
- Subject: Re: Converting a CFImageRef to a NSImage
- From: "Felipe Monteiro de Carvalho" <email@hidden>
- Date: Thu, 5 Jun 2008 21:28:50 -0300
Umm ... I am getting closer to the problem. It seams to be something
in the Pascal - Cocoa bindings. Here is the constructor for
[NSGraphicsContext currentContext]
constructor NSGraphicsContext.currentContext;
type
TmsgSendWrapper = function (param1: objc.id; param2: SEL): objc.id; cdecl;
var
vmethod: TmsgSendWrapper;
begin
ClassID := getClass();
vmethod := TmsgSendWrapper(@objc_msgSend);
Handle := vmethod(ClassID,
sel_registerName(PChar(StrNSGraphicsContext_currentContext)));
end;
It returns zero in the Handle because the ClassID is zero:
class function NSGraphicsContext.getClass: objc.id;
begin
Result := objc_getClass(StrNSGraphicsContext_NSGraphicsContext);
end;
The constant is declared as:
StrNSGraphicsContext_NSGraphicsContext = 'NSGraphicsContext';
It's a mistery to me why NSGraphicsContext.getClass returns zero ...
It works with basically the same code in all other classes covered by
the bindings.
thanks,
--
Felipe Monteiro de Carvalho
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden