[aida] Picture as String

che charlz.e at gmx.de
Fri Feb 13 11:26:09 CET 2009


Thanks Janko,

but what really helps is this.

Make this Methode under class String.

contentsAsMethod: path
     "return a body of method with a literal array with contents
      of that string"

     | input output |
     input := FileStream read: path text: false.
     output := WriteStream with: String new.
     output nextPutAll: '^#['.
     [input atEnd] whileFalse:
             [output
                 nextPutAll: input next asInteger asString;
                 nextPut: $ ].
     output nextPutAll: ']'.
     ^output contents


Then let it display in your workspace:

String new contentsAsMethod: 'c:\123\picture.jpg'





More information about the Aida mailing list