Yes - the interesting thing is, if I turn the grid on for the IKImageView,
it is plainly well able to recognise the transparency layer in my PNG and
render accordingly.  We are overriding IKImageView already, although we're
not yet doing anything funky at all, just adding helper methods and handling
keypresses.  I will try what you've suggested.  My other idea is, if the
control can display itself transparently on top of a window, I may try
taking a screenshot of the area underneath and then house my IKImageView in
another control, and in that control, set the background image to fake
transparency.
We need IKImageView to give us flip, rotate, zoom and pan.  We may well have
to write our own, but right now, that will take longer than I have to get
ready for a demo, so I'm going to persist with trying to get this to work

Thanks for the help

Christian

On Tue, Feb 10, 2009 at 11:25 AM, Steve Christensen <puns...@mac.com> wrote:

> Sorry, I misread your original posting. You're trying to make the view
> transparent, not the window. Based on what you're seeing when you set the
> view's backgroundColor, it looks like the alpha component is being ignored.
> I would guess that either the IKImageView only supports an opaque background
> or you need to play with it some more to get transparency to work. One way
> to find out would be to subclass IKImageView and override NSView's isOpaque
> method, returning NO.
>
> Also, depending on what you're trying to do, you could always use
> NSImageView since that does respect transparency, at least when I've tried
> it with the non-bordered version.
>
>
> On Feb 9, 2009, at 3:10 PM, Christian Graus wrote:
>
> I'm sorry, I'm not sure that I'm following this.
> Looking at it more closely, on the side I want this behaviour, it's just an
> IKImageView derived class on top of a window.  So, I just need to make the
> IKImageView show the image, transparently.  I've tried setting the Opaque
> setting, but it doesn't appear to have one.  I've also tried setting the
> background color to what you've shown here ( it gives me a white background
> ) or clearColor ( which gives me a black background ).  Is there something I
> am missing ?
>
> Thanks for your help
>
> Christian
>
> On Tue, Feb 10, 2009 at 9:18 AM, Steve Christensen <puns...@mac.com>wrote:
>
>> Something similar to what you're asking was discussed on this list last
>> week. To get you started:
>>
>> [window setOpaque:NO];
>> [window setBackgroundColor:[NSColor colorWithCalibratedWhite:1.0
>> alpha:0.5]];
>>
>>
>>
>>
>> On Feb 9, 2009, at 1:55 PM, Christian Graus wrote:
>>
>>  I have a window with an image showing on it.  Above this I have a window,
>>> which contains an IKImageView derived class.  The IKImageView has a PNG
>>> in
>>> it, which has a transparency layer.  What I need to do, is to make that
>>> image appear above the image I have in my main window, that is, the
>>> control
>>> needs to be transparent, so that one picture appears above another.  I've
>>> found a sample that sets the window alpha, but that fades the whole
>>> window,
>>> I just want to make the background transparent.  I'd appreciate any
>>> suggestions.
>>>
>>
>
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to