Ejemplo n.º 1
0
        public TPdfImageTexture(int aPatternId, Image aImage, float[] aPatternMatrix) : base(aPatternId, TPdfToken.PatternPrefix)
        {
            ImgWidth      = aImage.Width;
            ImgHeight     = aImage.Height;
            PatternMatrix = aPatternMatrix;

            ImageDef = new TPdfImage(aImage, 0, null, -1, false);
        }
Ejemplo n.º 2
0
        internal TPdfImage AddImage(Image aImage, Stream ImageData, long transparentColor, bool defaultToJpg)
        {
            TPdfImage SearchImage = new TPdfImage(aImage, Images.Count, ImageData, transparentColor, defaultToJpg);
            int Index = Images.BinarySearch(0, Images.Count, SearchImage, null);  //Only BinarySearch compatible with CF.

            if (Index < 0)
                Images.Insert(~Index, SearchImage);
            else SearchImage = Images[Index];
            return SearchImage;
        }
Ejemplo n.º 3
0
        public int CompareTo(object obj)
        {
            TPdfImage i2 = (obj as TPdfImage);

            if (i2 == null)
            {
                return(1);
            }
            int l = FImage.Length.CompareTo(i2.FImage.Length);

            if (l != 0)
            {
                return(l);
            }
            for (int i = 0; i < FImage.Length; i++)
            {
                int z = FImage[i].CompareTo(i2.FImage[i]);
                if (z != 0)
                {
                    return(z);
                }
            }

            int tp = FTransparentColor.CompareTo(i2.FTransparentColor);

            if (tp != 0)
            {
                return(tp);
            }

            if (FSMask == null)
            {
                if (i2.FSMask != null)
                {
                    return(-1);
                }
                else
                {
                    return(0);
                }
            }

            if (i2.FSMask == null)
            {
                return(1);
            }

            l = FSMask.Length.CompareTo(i2.FSMask.Length);
            if (l != 0)
            {
                return(l);
            }
            for (int i = 0; i < FSMask.Length; i++)
            {
                int z = FSMask[i].CompareTo(i2.FSMask[i]);
                if (z != 0)
                {
                    return(z);
                }
            }


            return(0);
        }
Ejemplo n.º 4
0
 internal void SelectImage(TPdfStream DataStream, Image aImage, Stream ImageData, long transparentColor, bool defaultToJpg)
 {
     TPdfImage SearchImage = AddImage(aImage, ImageData, transparentColor, defaultToJpg);
     SearchImage.Select(DataStream);
 }