<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>For the record, here is what I did. Instead of the Form I have
the original picture format encoded in the method (JPG, PNG
whatever), it will be smaller.<br>
</p>
<ul>
<li>Read the picture contents as binaryContents</li>
</ul>
<p>I execute with Ctrl-I : <font face="monospace">'/home/hilaire/myPicture.jpg'
asFileEntry binaryContents</font></p>
<ul>
<li>An insepctor on a BinaryArray with the full content is open.
It looks like [153 234 ...]. I copy the array in a method
returning it:</li>
</ul>
<p><font face="monospace">pictureData</font></p>
<p><font face="monospace"> ^ [153 234 ...]</font><br>
</p>
<ul>
<li>Another method will return the Form instance based on this
picture data:</li>
</ul>
<font face="monospace">samplePicture<br>
</font>
<p><font face="monospace"> ^ Form fromBinaryStream: self
pictureData readStream</font></p>
<p><br>
</p>
<p>Hilaire<br>
</p>
<div class="moz-cite-prefix">Le 02/08/2024 à 16:27, Hilaire
Fernandes a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:222c76ed-35e3-432b-9b4c-01eacef246cd@free.fr">Hi folks,
<br>
<br>
What is the best practice to encode a Form within a method in a
package file .pck.st ?
<br>
<br>
I found I can write:
<br>
<br>
String streamContents: [:str | form storeOn: str]
<br>
<br>
but the size is multiplied by 10.
<br>
<br>
What are other options?
<br>
<br>
Thanks
<br>
<br>
Hilaire
<br>
<br>
</blockquote>
</body>
</html>