Bitmap-Arrays to large for "contents"

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

Bitmap-Arrays to large for "contents"

Hans Gruber
Hi Squeak-Fans!

I am new in programming squeak an I have the following problem:

I want to integrate bitmap-arrays in my project for the images used in it. To get the elements for my bit-map array I used:

| image stream |
image := ColorForm fromFileNamed:
'/path/to/picture/icon.gif'.
stream := WriteStream with: String new.
image storeOn: stream.
stream contents.

By inspecting contents I can copy & paste its elements to the corresponding methods for the image. The Problem now is, that some of my images generate more bitmap-code elements than "contents" can display. Do you have an Idea how may copy&paste all the elements of the Stream!? I tried Seaside WAFileLibrary and pasted the generated methods, but WAFileLibrary returns byte-arrays, which can't be interpretet within the squeak form of *Morph.

So does anybody of you have an Idea and may help me?

Thanks,
Regards.

______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Bitmap-Arrays to large for "contents"

Bert Freudenberg
On 22.12.2009, at 03:17, Hans Gruber wrote:

>
> Hi Squeak-Fans!
>
> I am new in programming squeak an I have the following problem:
>
> I want to integrate bitmap-arrays in my project for the images used in it. To get the elements for my bit-map array I used:
>
> | image stream |
> image := ColorForm fromFileNamed:
> '/path/to/picture/icon.gif'.
> stream := WriteStream with: String new.
> image storeOn: stream.
> stream contents.
>
> By inspecting contents I can copy & paste its elements to the corresponding methods for the image. The Problem now is, that some of my images generate more bitmap-code elements than "contents" can display. Do you have an Idea how may copy&paste all the elements of the Stream!? I tried Seaside WAFileLibrary and pasted the generated methods, but WAFileLibrary returns byte-arrays, which can't be interpretet within the squeak form of *Morph.
>
> So does anybody of you have an Idea and may help me?

Your last line could become

        Clipboard clipboardText: stream contents

However, the canonical way would be to simply generate the method rather than doing it manually. Generating a method can be as simple as

        MyClass compile: 'myMethod ^42'

See, for example, MenuIcons>>importIconNamed:.

- Bert -

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners