Q&A

  • 유니트 선언부에 다음과 같은 내용을 추가하세요
유니트 선언부에 다음과 같은 내용을 추가하세요



implementation 위에 ...



CONST

PixelCountMax = 32768;

TYPE

pRGBTripleArray = ^TRGBTripleArray;

TRGBTripleArray = ARRAY[0..PixelCountMax-1] OF TRGBTriple;



설명:이는 델파이 자체의 TRGBTripleArray 선언의 PixelCountmax가 1 Byte 이기 때문으로

고해상도 비트맵 화소 처리에 부적합하기 때문이다.

자세한 사항은 아래 내용을 참조 하기 바란다.



Borland defines a TRGBTripleArray in the Graphics.PAS unit, but it is an ARRAY[BYTE] of TRGBTriple.



Danny Thorpe's (Borland R&D) comments:



That's because that array type is for convenience when dealing with color palettes. It is not intended for pixel access. You'll notice that in the evolution from D1 to D4, I've eliminated a lot of temporary memory allocations in the bitmap routines. One of the big timesavers was not allocating heap memory for temporary color palettes. Instead I just use a local variable on the stack of the maximum possible size I'll need: 256 RGBTriples. That burns between 700 and 1k bytes of stack space, but stack is cheap in Win32 and it will be recycled in a few nanoseconds.



That wouldn't work with a TRGBTripleArray type with a WORD range. Even if it didn't blow the stack, it'd still be prohibitively expensive.



Gromit 이었습니다.~ (-:



0  COMMENTS