With<0, get to memr but w and h of image are wrong

    load 'c:\data\gdiplus.ijs'
    require 'dll'
    load 'viewmat'

    NB. GdiplusStartupInput =: 1 0 0 0+0*4
    BitmapData =: 'WdthHghtStrdFrmtScanRsrv'

    GdiplusStartup (TOK=:,_1);GdiplusStartupInput;0
0
    TOK
183471116
    y=:'c:\data\atkiln.jpg'
    NB.   GdipCreateBitmapFromFile y;BMP=.,_1
      GdipCreateBitmapFromFile y;BMP=:,_1
0
    y
c:\data\atkiln.jpg
    NB. bmpARGB
    ]  DATA=: i.4%~#BitmapData
0 1 2 3 4 5
    ]y=:{.BMP
60912368
    NB.   GdipBitmapLockBits y;0;ImageLockModeRead;PixelFormat32bppARGB;DATA
      GdipBitmapLockBits y;(<0);1;PixelFormat32bppARGB;DATA
┌─┬────────┬───┬─┬───────┬───────────────────────────────────────────────┐
│0│60912368│┌─┐│1│2498570│3006477107668 10731276436768592 116457472 1 4 5│
│ │        ││0││ │       │                                               │
│ │        │└─┘│ │       │                                               │
└─┴────────┴───┴─┴───────┴───────────────────────────────────────────────┘
      'w h s f p r'=: DATA
    NB.   z=. (h,w)$memr p,0,(w*h),JINT
      z=. (h,w)$memr p,0,(w*h),4
|domain error: memr
|   z=.(h,w)$    memr p,0,(w*h),4
|[-20] c:\data\io.ijs




On 1/11/2012 11:21 AM, bill lam wrote:
> That line in api prototype might be incorrect, try coerce it into a null
> pointer eg,
>
>     GdipBitmapLockBits y;(<0);ImageLockModeRead;PixelFormat32bppARGB;DATA
>
> Срд, 11 Янв 2012, Cliff Reiter писал(а):
>> Here is what I run into, J6.02 64bit, using api/gdiplus but using
>> platimg as a template
>>
>>      load 'c:\data\gdiplus.ijs'
>>      require 'dll'
>>      load 'viewmat'
>>
>>      GdiplusStartupInput =: 1 0 0 0
>>      BitmapData =: 'WdthHghtStrdFrmtScanRsrv'
>>
>>      GdiplusStartup (TOK=:,_1);GdiplusStartupInput;0
>> 0
>>      y=:'c:\data\atkiln.jpg'
>>        GdipCreateBitmapFromFile y;BMP=.,_1
>> 0
>>
>>      NB. bmpARGB
>>      ]  DATA=: i.4%~#BitmapData
>> 0 1 2 3 4 5
>>      y=:{.BMP
>>        GdipBitmapLockBits y;0;ImageLockModeRead;PixelFormat32bppARGB;DATA
>> |domain error: cd
>> |       GdipBitmapLockBits y;0;ImageLockModeRead;PixelFormat32bppARGB;DATA
>> |[-14] c:\data\io.ijs
>>
>>
>> On 1/11/2012 10:01 AM, bill lam wrote:
>>> Oleg's platimg only works for 32-bit, while api/gdiplus and api/gdi32
>>> (should) work for both 32-bit and 64-bit.  Those x's usually stand for
>>> pointers whose length depend on 32/64-bit OS.
>>>
>>> Please provide a minimun example showing how it didn't work for GDI/API.
>>>
>>> Срд, 11 Янв 2012, Cliff Reiter писал(а):
>>>> In thinking about the best way to move forward the best of image3 addon
>>>> to 64 bit and J7 it seems to me that using OS resources would be
>>>> preferred over porting the image3 dll source to 64 bit. In the platimg
>>>> addon I see that Oleg managed that nicely in J6 32. I presume this has
>>>> also been done in J7 based on the J7 api/gdi addon. Any pointers to
>>>> where I should look for examples to that?
>>>>
>>>>
>>>> -- 
>>>> Clifford A. Reiter
>>>> Lafayette College, Easton, PA 18042
>>>> http://webbox.lafayette.edu/~reiterc/
>>>>
>>>> ----------------------------------------------------------------------
>>>> For information about J forums see http://www.jsoftware.com/forums.htm
>> -- 
>> Clifford A. Reiter
>> Lafayette College, Easton, PA 18042
>> http://webbox.lafayette.edu/~reiterc/
>>
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm

-- 
Clifford A. Reiter
Lafayette College, Easton, PA 18042
http://webbox.lafayette.edu/~reiterc/

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to