[Pharo-project] merging images?
Hi, I wonder if there is a way to merge two Form objects into a new one? I'm trying to add "status" to some icons, something like "filter active" an icon with a mark, "filter inactive", another mark. Of course, I can create two different icons, but I thought "it would be nice to have this as a general functionality" :) Cheers, Esteban
The class BitBlt by Dan Ingalls does this. Lukas On 10 June 2011 14:41, Esteban Lorenzano <estebanlm@gmail.com> wrote:
Hi, I wonder if there is a way to merge two Form objects into a new one? I'm trying to add "status" to some icons, something like "filter active" an icon with a mark, "filter inactive", another mark. Of course, I can create two different icons, but I thought "it would be nice to have this as a general functionality" :)
Cheers, Esteban
-- Lukas Renggli www.lukas-renggli.ch
Nice idea Esteban! As Lukas pointed out, BitBlt is the revolutionary bitmap combination strategy algorithm the Dan invented long ago, which enabled the first graphical user interfaces for OOP. It's all about combination rules, check out the class side examples. Also check out the protocol of Form, a lot of nice things there. I'm using many animations from there in the next Gaucho. Seems that you could use Form>>stencil. A hint on how to use it: ColorForm>>twoToneFromDisplay: aRectangle backgroundColor: bgColor. Saludos, Fernando On Fri, Jun 10, 2011 at 3:05 PM, Lukas Renggli <renggli@gmail.com> wrote:
The class BitBlt by Dan Ingalls does this.
Lukas
On 10 June 2011 14:41, Esteban Lorenzano <estebanlm@gmail.com> wrote:
Hi, I wonder if there is a way to merge two Form objects into a new one? I'm trying to add "status" to some icons, something like "filter active" an icon with a mark, "filter inactive", another mark. Of course, I can create two different icons, but I thought "it would be nice to have this as a general functionality" :)
Cheers, Esteban
-- Lukas Renggli www.lukas-renggli.ch
cool... I followed second gary option and it is working... now there are some issues with glamour updates, but the icons looks great :) best, Esteban El 10/06/2011, a las 10:32a.m., Fernando Olivero escribió:
Nice idea Esteban! As Lukas pointed out, BitBlt is the revolutionary bitmap combination strategy algorithm the Dan invented long ago, which enabled the first graphical user interfaces for OOP.
It's all about combination rules, check out the class side examples.
Also check out the protocol of Form, a lot of nice things there. I'm using many animations from there in the next Gaucho.
Seems that you could use Form>>stencil. A hint on how to use it: ColorForm>>twoToneFromDisplay: aRectangle backgroundColor: bgColor.
Saludos, Fernando
On Fri, Jun 10, 2011 at 3:05 PM, Lukas Renggli <renggli@gmail.com> wrote:
The class BitBlt by Dan Ingalls does this.
Lukas
On 10 June 2011 14:41, Esteban Lorenzano <estebanlm@gmail.com> wrote:
Hi, I wonder if there is a way to merge two Form objects into a new one? I'm trying to add "status" to some icons, something like "filter active" an icon with a mark, "filter inactive", another mark. Of course, I can create two different icons, but I thought "it would be nice to have this as a general functionality" :)
Cheers, Esteban
-- Lukas Renggli www.lukas-renggli.ch
Many ways... If you're not concerned with all being in one form you could use a CompositeFillStyle made up of ImageFillStyles for each layer. (Morph new fillStyle: (CompositeFillStyle fillStyles: { ImageFillStyle form: UITheme current infoIcon. (ImageFillStyle form: UITheme current smallWarningIcon) origin: 32 @ 32})) extent: 48@48; openInHand Otherwise |form| form := UITheme current infoIcon deepCopy. form getCanvas translucentImage: UITheme current smallWarningIcon at: 32 @ 32. Display getCanvas translucentImage: form at: 50@40 Regards, Gary ----- Original Message ----- From: "Esteban Lorenzano" <estebanlm@gmail.com> To: "Pharo Development" <pharo-project@lists.gforge.inria.fr> Sent: Friday, June 10, 2011 1:41 PM Subject: [Pharo-project] merging images? Hi, I wonder if there is a way to merge two Form objects into a new one? I'm trying to add "status" to some icons, something like "filter active" an icon with a mark, "filter inactive", another mark. Of course, I can create two different icons, but I thought "it would be nice to have this as a general functionality" :) Cheers, Esteban
Esteban, A partial reply: for images, it is "easy" - not sure about icons. I often write code to annotate images; #getCanvas is the starting point. From there, you can draw pretty much whatever you want on an ordinary Form instance. The form can be loaded from a file or created to size and splattered with subsets of images loaded from disk, etc. I have long been under the impression that icons are somehow different, having size (not a big deal), transparency (more trouble?) and ultimately storage and file format requirements (not sure). It would indeed be nice to be able to easily manipulate icons in the image. It appears that some among us know how to do it :) Bill ________________________________________ From: pharo-project-bounces@lists.gforge.inria.fr [pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Esteban Lorenzano [estebanlm@gmail.com] Sent: Friday, June 10, 2011 8:41 AM To: Pharo Development Subject: [Pharo-project] merging images? Hi, I wonder if there is a way to merge two Form objects into a new one? I'm trying to add "status" to some icons, something like "filter active" an icon with a mark, "filter inactive", another mark. Of course, I can create two different icons, but I thought "it would be nice to have this as a general functionality" :) Cheers, Esteban
participants (5)
-
Esteban Lorenzano -
Fernando Olivero -
Gary Chambers -
Lukas Renggli -
Schwab,Wilhelm K