C (237/304)

From:Sensei
Date:27 Aug 2000 at 01:59:47
Subject:Re: ReadPixelLine8

Czesc Rene!

Dnia 26-Sie-00, Rene Hartmann napisa�:

>Hi! Have the ReadPixelLine8 a bug? I defined an array with ubytes. UBYTE
>array[40] { 1,2,2,2,1,1... }; InitRastPort(&tmprp);

You should not use local/global arrays with initialized data when you're using
WritePixelLine8()/WritePixelArray8() (or you must have special attention while
you're doing this), because they clear source array of pixels... You should
not use this feature, patches like NewWPA, PatchWPA, BlazeWCP or REDWPA don't
do this AFAIR...

>tmprp.BitMap=AllocBitMap(40,1,8,CLEAR,NULL); tmprp.Layer =NULL; And draw a
>line with WritePixelLine8(win->RPort,0,0,40,data,&tmprp). I use the same
>tmprp for read a line. ReadPixelLine8(&scr->RastPort,0,0,40,data,&tmprp);
>But here are no data stored in the data array. I have the same Problem when i
>read a line from any window. Can anybody help me? thanks...

You MUST allocate array and bitmap with width aligned to 16 pixels (use 48 if
you're hardcoding 40 as above or ((width+15)&~15) for width and
(((width+15)>>4)<<1) for bytes per row) as autodocs says.

If you have any troubles first read carefully autodocs of funtions which
you're using...

Regards!



Can your ImageFX paint like bitmap painters?
Download: gfx/ifx/REDFiX.lha, ftp.novadesign.com

Przemyslaw 'SENSEI' Gruchala

code/gfx2d/gfx3d/webmaster

Amiga 1200
Apollo 1240/33 MHz, 18 MB RAM, BTC 33.6 bps
HDD 3.2 GB, HDD 520 MB, CD x12

---------------------------------------
Darmowe kursy HTML, JavaScript, Flash
http://fabryka.republika.pl/kurs/
---------------------------------------