示例#1
0
        public void Print(Graphics graphics, RectangleF box, int imageResolution)
        {
            var state = graphics.Save();

            FillBox(box, graphics);

            var imageBox = box;

            if (FilmBox.Trim == "YES")
            {
                imageBox.Inflate(-Hundredths, -Hundredths);
            }

            if (ImageSequence != null && ImageSequence.Contains(DicomTag.PixelData))
            {
                Image bitmap = null;
                try
                {
                    var image = new DicomImage(ImageSequence);
                    var frame = image.RenderImage();

                    bitmap = frame;// new Bitmap(frame);
                    //frame.Dispose();

                    DrawBitmap(graphics, box, bitmap, imageResolution);
                }
                finally
                {
                    if (bitmap != null)
                    {
                        bitmap.Dispose();
                    }
                }
            }

            graphics.Restore(state);
        }