From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Reitter Newsgroups: gmane.emacs.devel Subject: png images in tool-bar / alpha mask Date: Tue, 1 Apr 2008 18:14:45 +0100 Message-ID: <6C1A0020-7B4B-4202-8757-B818A066D40A@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v919.2) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1207070135 8945 80.91.229.12 (1 Apr 2008 17:15:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Apr 2008 17:15:35 +0000 (UTC) To: emacs- devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 01 19:16:07 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Jgk5U-0003iS-0E for ged-emacs-devel@m.gmane.org; Tue, 01 Apr 2008 19:15:56 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jgk4r-0007Ai-OZ for ged-emacs-devel@m.gmane.org; Tue, 01 Apr 2008 13:15:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jgk4Z-00073k-3h for emacs-devel@gnu.org; Tue, 01 Apr 2008 13:14:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jgk4W-00071B-9c for emacs-devel@gnu.org; Tue, 01 Apr 2008 13:14:58 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jgk4V-00070t-VO for emacs-devel@gnu.org; Tue, 01 Apr 2008 13:14:56 -0400 Original-Received: from rn-out-0910.google.com ([64.233.170.190]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jgk4V-0004G7-NS for emacs-devel@gnu.org; Tue, 01 Apr 2008 13:14:55 -0400 Original-Received: by rn-out-0910.google.com with SMTP id e21so1339109rng.6 for ; Tue, 01 Apr 2008 10:14:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:from:to:content-type:content-transfer-encoding:mime-version:subject:date:x-mailer; bh=GsrUFPdIUYjjj1EdA06z30SYwgG/5k1dT+c/hjWPWc8=; b=FuQW1I2RoGM7Z1ewuI0MlLTeXXBJkyYmyvkJJxOSVFRsrH+zHSj6vx8weHpCrGYTryt5PrHKVwhhkIzwGRo8dPna6CEaHr3EQ1naAGSwI+Q5eaILCKPQ4Ksz5KJSOsVzeGshXnoRbFGFWzEt7Zzznj0nWCG9bq7gQkl+ooO0h9E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:from:to:content-type:content-transfer-encoding:mime-version:subject:date:x-mailer; b=RL2XCUbqi9O8XQMm+K7W2pZR7mSkAQyxlMJ2cwMLfObvZLiSg07RGjZ/8dmXwCZhwEOGxodPo/zShBmbSMOVqrejMc9oIc+TC2qULhGHOqmUMeAAR3+dXvlRAXJwGtu3NzQG7nSa/sQoezTc8XGEFThrUuzn337L9h8pnDjsh4I= Original-Received: by 10.114.156.1 with SMTP id d1mr12816894wae.120.1207070092555; Tue, 01 Apr 2008 10:14:52 -0700 (PDT) Original-Received: from scarlett.inf.ed.ac.uk ( [129.215.174.113]) by mx.google.com with ESMTPS id d23sm881081nfh.12.2008.04.01.10.14.49 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 01 Apr 2008 10:14:50 -0700 (PDT) X-Mailer: Apple Mail (2.919.2) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:94129 Archived-At: I'm trying to use PNG images with alpha information in the tool-bar and find that the mask / alpha is ignored: (find-image (list (list :type 'png :file "undo.png"))) i.e. I'm not setting a ":mask 'heuristic" property here. The background just appears white. This is with the new toolkit toolbars (under Carbon), but I remember having such problems with the non-toolkit toolbar as well. `image-make-p' generally returns nil for PNGs. It seems that "image_load_quartz2d" is used to load the file (in image.c). This already determines some background colors and draws it into a new graphics context, with the background color present. And then it doesn't actually store the original image data, but creates an XCreatePixmap. (A mask is handled separately.) Would the solution be to also store the original image data (CGImageRef) in the "struct image", and then to simply use that when defining the toolbar, if it is present and if the toolkit supports it? As is probably obvious, I'm not familiar with how this is generally handled in Emacs, but if someone could provide a bit of guidance, I could try to make it work.