• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Background application is visible when I try to display a transparent backgrounded image into my app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Background application is visible when I try to display a transparent backgrounded image into my app


  • Subject: Re: Background application is visible when I try to display a transparent backgrounded image into my app
  • From: Ken Ferry <email@hidden>
  • Date: Thu, 24 Sep 2009 14:02:48 -0700

On Wed, Sep 23, 2009 at 11:21 PM, Symadept <email@hidden> wrote:

> Hi,
> I am trying to display an Image whose background is transparent as a
> buttoncell. Then the application background of my app or the desktop is
> visible and when I clicked on it, it focuses to the visible app.
>
> Why it is so happening.
>
> Code goes like this.
>
> Subclassed the NSButtonCell and tried to associate my Buttoncell from IB.
>
> mImage = [NSImage imageNamed:@"TransparentImage"];
>
>
> - (void)drawWithFrame:(NSRect)bounds inView:(NSView *)controlView
>
> {
>
>    NSRect imageRect = bounds;//[self imageRectForBounds:bounds];
>
>    if (mImage != nil) {
>
>        [mImage setFlipped:[controlView isFlipped]];
>

This is not your immediate problem, but -setFlipped: is deprecated, and it's
deprecated because people try to use it like this, which is incorrect.
 Please see the AppKit release notes, or, say, <
http://www.noodlesoft.com/blog/2009/02/02/understanding-flipped-coordinate-systems/
>.


>        [mImage drawInRect:imageRect fromRect:NSZeroRect operation:
> * NSCompositeSourceIn* fraction:1.0];
>

NSCompositeSourceIn is an unusual compositing operation that you only want
in very specific circumstances.  You almost certainly want
NSCompositeSourceOver.  This is probably the problem.


>
>    }
>
> }
>
>
> What am I missing here.
>
>
> Kindly help me in this regards.
>
>
> Best regards
>
> Mustafa Shaik
> _______________________________________________
>
> 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
>
_______________________________________________

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

References: 
 >Background application is visible when I try to display a transparent backgrounded image into my app (From: Symadept <email@hidden>)

  • Prev by Date: UIPickerView: How do I LOOP data, as is done in UIDatePicker {looping Jan thru Dec} vs a mere list?
  • Next by Date: Possible to set control's action in IB, set target programmatically?
  • Previous by thread: Background application is visible when I try to display a transparent backgrounded image into my app
  • Next by thread: UIPickerView: How do I LOOP data, as is done in UIDatePicker {looping Jan thru Dec} vs a mere list?
  • Index(es):
    • Date
    • Thread