コード例 #1
0
ファイル: PdfResources.cs プロジェクト: mwilian/demos
		internal void SelectPattern(TPdfStream DataStream, Image aImage, real[] PatternMatrix)
		{
			TPdfImageTexture SearchPattern = new TPdfImageTexture(ImageTexturePatterns.Count, aImage, PatternMatrix);
			int Index = ImageTexturePatterns.BinarySearch(0, ImageTexturePatterns.Count, SearchPattern, null);  //Only BinarySearch compatible with CF.

			if (Index < 0)
				ImageTexturePatterns.Insert(~Index, SearchPattern);
			else SearchPattern = ImageTexturePatterns[Index];

			SearchPattern.Select(DataStream);
		}
コード例 #2
0
        public int CompareTo(object obj)
        {
            TPdfImageTexture p2 = obj as TPdfImageTexture;

            if (p2 == null)
            {
                return(obj.GetType().GUID.CompareTo(this.GetType().GUID));
            }

            for (int i = 0; i < PatternMatrix.Length; i++)
            {
                int Result = PatternMatrix[i].CompareTo(p2.PatternMatrix[i]);
                if (Result != 0)
                {
                    return(Result);
                }
            }

            return(ImageDef.CompareTo(p2.ImageDef));
        }