How to create a 16x16 icon from a .png file?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

How to create a 16x16 icon from a .png file?

abergel
Hi!

A couple of month ago the following expression was working:
ThemeIcons new createIconMethodsFromFile: 'cube' directory: '/Users/alexandrebergel/Desktop/cube’

Now it does not. How can I import .png files in Pharo?

Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




Reply | Threaded
Open this post in threaded view
|

Re: How to create a 16x16 icon from a .png file?

Peter Uhnak
Look at IconFactory http://smalltalkhub.com/#!/~peteruhnak/IconFactory

On Tue, Dec 22, 2015 at 2:11 PM, Alexandre Bergel
<[hidden email]> wrote:

> Hi!
>
> A couple of month ago the following expression was working:
> ThemeIcons new createIconMethodsFromFile: 'cube' directory: '/Users/alexandrebergel/Desktop/cube’
>
> Now it does not. How can I import .png files in Pharo?
>
> Cheers,
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: How to create a 16x16 icon from a .png file?

kilon.alios
In reply to this post by abergel
please note that its not required to covnert a png to a method source if you use git because git can handle versioning binary files just fine. All you have to do is access your local github-cache and retrieve the image from there (assuming the image has been added to your github repository).

From there one is just a matter of using Form fromFileNamed: aStringPathToYourPNG

if you dont use git, use Peter's IconFactory.

On Tue, Dec 22, 2015 at 3:12 PM Alexandre Bergel <[hidden email]> wrote:
Hi!

A couple of month ago the following expression was working:
ThemeIcons new createIconMethodsFromFile: 'cube' directory: '/Users/alexandrebergel/Desktop/cube’

Now it does not. How can I import .png files in Pharo?

Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




Reply | Threaded
Open this post in threaded view
|

Re: How to create a 16x16 icon from a .png file?

abergel
Exactly!


> On Dec 22, 2015, at 4:46 PM, Dimitris Chloupis <[hidden email]> wrote:
>
> please note that its not required to covnert a png to a method source if you use git because git can handle versioning binary files just fine. All you have to do is access your local github-cache and retrieve the image from there (assuming the image has been added to your github repository).
>
> From there one is just a matter of using Form fromFileNamed: aStringPathToYourPNG
>
> if you dont use git, use Peter's IconFactory.
>
> On Tue, Dec 22, 2015 at 3:12 PM Alexandre Bergel <[hidden email]> wrote:
> Hi!
>
> A couple of month ago the following expression was working:
> ThemeIcons new createIconMethodsFromFile: 'cube' directory: '/Users/alexandrebergel/Desktop/cube’
>
> Now it does not. How can I import .png files in Pharo?
>
> Cheers,
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




Reply | Threaded
Open this post in threaded view
|

Re: How to create a 16x16 icon from a .png file?

abergel
In reply to this post by Peter Uhnak
Ah yes!

Thanks!

Alexandre


> On Dec 22, 2015, at 12:01 PM, Peter Uhnák <[hidden email]> wrote:
>
> Look at IconFactory http://smalltalkhub.com/#!/~peteruhnak/IconFactory
>
> On Tue, Dec 22, 2015 at 2:11 PM, Alexandre Bergel
> <[hidden email]> wrote:
>> Hi!
>>
>> A couple of month ago the following expression was working:
>> ThemeIcons new createIconMethodsFromFile: 'cube' directory: '/Users/alexandrebergel/Desktop/cube’
>>
>> Now it does not. How can I import .png files in Pharo?
>>
>> Cheers,
>> Alexandre
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




Reply | Threaded
Open this post in threaded view
|

Re: How to create a 16x16 icon from a .png file?

abergel
In reply to this post by Peter Uhnak
Peter, I have updated the help based on your icon factory. Your code is very easy to use, and it is available from the catalog. Pretty cool!
https://pharo.fogbugz.com/f/cases/17291/The-ImportingResourceHelp-has-to-be-updated

The monkey will go over it soon I guess.

In case you wish to improve it, it would be great to have a resize function :-)

Cheers,
Alexandre


> On Dec 22, 2015, at 12:01 PM, Peter Uhnák <[hidden email]> wrote:
>
> Look at IconFactory http://smalltalkhub.com/#!/~peteruhnak/IconFactory
>
> On Tue, Dec 22, 2015 at 2:11 PM, Alexandre Bergel
> <[hidden email]> wrote:
>> Hi!
>>
>> A couple of month ago the following expression was working:
>> ThemeIcons new createIconMethodsFromFile: 'cube' directory: '/Users/alexandrebergel/Desktop/cube’
>>
>> Now it does not. How can I import .png files in Pharo?
>>
>> Cheers,
>> Alexandre
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




Reply | Threaded
Open this post in threaded view
|

Re: How to create a 16x16 icon from a .png file?

stepharo
In reply to this post by abergel
Look for users of ReadWriterPNG

ReadWriterPNG formFromStream: (Filesystem workingDirectory / 'blb.png)

Works

Le 22/12/15 14:11, Alexandre Bergel a écrit :
> Hi!
>
> A couple of month ago the following expression was working:
> ThemeIcons new createIconMethodsFromFile: 'cube' directory: '/Users/alexandrebergel/Desktop/cube’
>
> Now it does not. How can I import .png files in Pharo?
>
> Cheers,
> Alexandre


Reply | Threaded
Open this post in threaded view
|

Re: How to create a 16x16 icon from a .png file?

Peter Uhnak
In reply to this post by abergel
> In case you wish to improve it, it would be great to have a resize function :-)

I'll make a todo note for that.

Peter