[NTLK] Programming to get Graphics

Doug Denby ddenby at rogers.com
Wed Mar 31 22:33:26 EDT 2010

Hi Simon, hope it would be someone of your caliber that would pop up with some help. Here is a frame, as transferred from one of my Newton's to my Mac laptop:

{class:paperroll,data:[{viewFlags:1,viewBounds:{right:291,top:4,left:0,bottom:358},viewStationery:pict,label:"picture",icon:{bits:<pixels>,bitsBounds:{left:0,top:0,right:291,bottom:354},bounds:{left:0,top:0,right:291,bottom:354},depth:1,resolution:<resolution>,rowbytes:40,scanOffset:28,store:{_parent:<frame:5>,_proto:<frame:5>,store:52059463,soups:<_weakarray>,version:4},compandername:"TPixelMapCompander",companderdata:<none>,mask:NIL,colordata:NIL}}],titleSortOn:"Base Coolant System",labelsFilter:NIL,viewStationery:paperroll,height:381,title:"Base Coolant System",_version:2,timestamp:55707840,lastAccessTime:55871763,_uniqueID:6295,_modTime:54700349}

This is obviously a Notes App frame. You will note that within the data slot there is an icon slot:


While I find it interesting, it doesn't help me to capture the actual image data and transfer it to the Mac. I know that it is a bit map image created using NewtPaint, copied and pasted into the notePad.

I do see several items within diamond brackets. I assume that somehow I have to access the data referenced within these reference spots. You will note that the bits slot is not as you indicated.

Hoping for some help.


P.S. Is it possible to just connect to the dock app on the Newton? Where can I find the documentation on what commands it will respond to, and what data it will kick out in response to those commands?

P.S As near as I can see, NS_Basic can use the stock Newton Script commands. At least everything I have tried to this date works, although sometimes I needed to reread the documentation several times.

On 2010-03-31, at 4:24 AM, Simon Bell wrote:

> On 31 Mar 2010, at 01:50, Doug Denby wrote:
>> Let theRecord:= getStores() 
>> [theStore]:getSoup(theSoup):query(theQuery):move(theEntry)
>> The above code gets me the frame of an entry but alias and such are  
>> not displayed. Manipulation of the slots will get me a frame showing  
>> an Icon but I can not for the life of me figure out how to get what  
>> it referenced by the Icon.
> I’m not familiar with NS_Basic, so please forgive me if I  
> misunderstand your problem.
> An app icon is a frame looking like:
>  icon: {bits: <bits, length 132>,
>         mask: <bits, length 132>,
>         bounds: {left: 0, top: 0, right: 26, bottom: 29}}
> where the bits slot is a binary object containing a PixelMap: that’s  
> what you have to decode to a Mac image.
> More generally, a graphic is made up of an array of shapes: line,  
> rectangle, ink, text, etc. each of which has its own drawing rules.  
> Data in the Notes app is similar.
> Is this any help? Maybe if you gave a sample frame you’re having  
> problems with we could narrow it down.
> Simon
> ==================================================================== 
> The NewtonTalk Mailing List - http://newtontalk.net/
> The Official Newton FAQ     - http://splorp.com/newton/faq/
> The Newton Glossary         - http://splorp.com/newton/glossary/
> WikiWikiNewt                - http://tools.unna.org/wikiwikinewt/
> ====================================================================

More information about the NewtonTalk mailing list