Пример #1
0
        /// <summary>
        /// AddEmbeddedImageAnnot adds an embedded image annotation.
        /// </summary>
        /// <param name="leftPixels">The left coordinate of the annotation (pixels).</param>
        /// <param name="topPixels">The top coordinate of the annotation (pixels).</param>
        /// <param name="widthPixels">The width of the annotation (pixels).</param>
        /// <param name="heightPixels">The height of the annotation (pixels).</param>
        /// <param name="dib">Pointer to a Microsoft® Windows® Graphics Device Interface (GDI) BITMAPINFO structure, as IntPtr value.</param>
        public void AddEmbeddedImageAnnot(int leftPixels, int topPixels, int widthPixels, int heightPixels, IntPtr dib)
        {
            GdPictureImaging imaging = new GdPictureImaging();
            int id = imaging.CreateGdPictureImageFromDIB(dib);

            if (id < 0)
            {
                LastError = imaging.GetStat();
                return;
            }

            AnnotationEmbeddedImage annotationEmbeddedImage = _annotationManager.AddEmbeddedImageAnnot(id,
                                                                                                       ToInchesHorizontal(leftPixels), ToInchesVertical(topPixels),
                                                                                                       ToInchesHorizontal(widthPixels), ToInchesVertical(heightPixels));

            GdPictureStatus status = _annotationManager.GetStat();

            if (status != GdPictureStatus.OK)
            {
                LastError = status;
            }
        }