2013-03-07 4 views
0

나는 XE3 내 델파이 2006 포트 (PNG 파일)을 GraphicEx 구성 요소 라이브러리 (마지막으로 그것을 가지고) 기본 오류를 수정할 때, 나는이 오류 막혔다에 노력하고 있습니다 :GraphicEx InChunk() 함수를 수정하는 방법? 라인에서</p> <pre><code>"TPNGGraphic.IsChunk" invalid type cast </code></pre> <p>:

function TPNGGraphic.IsChunk(ChunkType: TChunkType): Boolean; 

// determines, independant of the cruxial 5ths bits in each "letter", whether the 
// current chunk type in the header is the same as the given chunk type 

const 
    Mask = not $20202020; 

begin 
    Result := (Cardinal(FHeader.ChunkType) and Mask) = (Cardinal(ChunkType) and Mask); // <-- this line 
end; 

누구든지이를 고쳐야합니까?

+1

에 PNG 내장 된 구성 요소는 사용자의 요구에 부응하지 않습니다 어떤 이유를 정의를 변경해보십시오. 아마도 GraphicEx는 더 이상 필요하지 않을 것입니다. –

+1

웹 서치 문제를 피하기 위해 라이브러리 이름이 매우 신중하게 선택되었습니다! –

답변

6

TChunkType은 그래서 컴파일러가 추기경으로 TChunkType 유형을 캐스팅 할 수

type 
    TChunkType = array[0..3] of Char; 

으로 정의된다.

type 
    TChunkType = array[0..3] of AnsiChar; 
+0

+1 코드는'Char'로 흩어져 있습니다. 많은 일이 필요합니다. –

+1

또는 http://www.songbeamer.com/delphi/에서 버전을 사용하십시오. –

+2

Woa ... 의도는보고 싶다는 생각이 들기 때문에 'byte [0..3] byte'로 선언하는 것이 더 좋습니다. 그 _chunk_ 문자 데이터로. – jachguate