Example #1
0
        /// <summary>
        /// Draws an <see cref="ImageGraphic"/>.
        /// </summary>
        protected override void DrawImageGraphic(ImageGraphic imageGraphic)
        {
            CodeClock clock = new CodeClock();

            clock.Start();

            const int bytesPerPixel = 4;

            Surface.ImageBuffer.Graphics.Clear(Color.FromArgb(0x0, 0xFF, 0xFF, 0xFF));

            BitmapData bitmapData = Surface.ImageBuffer.Bitmap.LockBits(
                new Rectangle(0, 0, Surface.ImageBuffer.Bitmap.Width, Surface.ImageBuffer.Bitmap.Height),
                ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);

            try
            {
                ImageRenderer.Render(imageGraphic, bitmapData.Scan0, bitmapData.Width, bytesPerPixel, Surface.ClientRectangle);
            }
            finally
            {
                Surface.ImageBuffer.Bitmap.UnlockBits(bitmapData);
            }

            Surface.FinalBuffer.RenderImage(Surface.ImageBuffer);

            clock.Stop();
            PerformanceReportBroker.PublishReport("GDIRenderer", "DrawImageGraphic", clock.Seconds);
        }
Example #2
0
        //internal for unit testing only.
        internal static void CalculateVisibleRectangles(
            ImageGraphic imageGraphic,
            Rectangle clientRectangle,
            out Rectangle dstVisibleRectangle,
            out RectangleF srcVisibleRectangle)
        {
            Rectangle  srcRectangle = new Rectangle(0, 0, imageGraphic.Columns, imageGraphic.Rows);
            RectangleF dstRectangle = imageGraphic.SpatialTransform.ConvertToDestination(srcRectangle);

            // Find the intersection between the drawable client rectangle and
            // the transformed destination rectangle
            dstRectangle = RectangleUtilities.RoundInflate(dstRectangle);
            dstRectangle = RectangleUtilities.Intersect(clientRectangle, dstRectangle);

            if (dstRectangle.IsEmpty)
            {
                dstVisibleRectangle = Rectangle.Empty;
                srcVisibleRectangle = RectangleF.Empty;
                return;
            }

            // Figure out what portion of the image is visible in source coordinates
            srcVisibleRectangle = imageGraphic.SpatialTransform.ConvertToSource(dstRectangle);
            //dstRectangle is already rounded, this is just a conversion to Rectangle.
            dstVisibleRectangle = Rectangle.Round(dstRectangle);
        }
Example #3
0
        /// <summary>
        /// Computes the maximum bounds for scales on a given <see cref="IPresentationImage"/>.
        /// </summary>
        /// <param name="presentationImage">The image to compute bounds for.</param>
        /// <param name="horizontalReduction">The percentage of width to subtract from both the client bounds and the source image bounds.</param>
        /// <param name="verticalReduction">The percentage of height to subtract from both the client bounds and the source image bounds.</param>
        /// <returns>The maximum scale bounds.</returns>
        private static Rectangle ComputeScaleBounds(IPresentationImage presentationImage, float horizontalReduction, float verticalReduction)
        {
            RectangleF clientBounds = presentationImage.ClientRectangle;
            float      hReduction   = horizontalReduction * Math.Min(1000f, clientBounds.Width);
            float      vReduction   = verticalReduction * Math.Min(1000f, clientBounds.Height);

            clientBounds = new RectangleF(clientBounds.X + hReduction, clientBounds.Y + vReduction, clientBounds.Width - 2 * hReduction, clientBounds.Height - 2 * vReduction);

            if (presentationImage is IImageGraphicProvider)
            {
                ImageGraphic imageGraphic = ((IImageGraphicProvider)presentationImage).ImageGraphic;
                Rectangle    srcRectangle = new Rectangle(0, 0, imageGraphic.Columns, imageGraphic.Rows);

                RectangleF imageBounds = imageGraphic.SpatialTransform.ConvertToDestination(srcRectangle);
                imageBounds = RectangleUtilities.ConvertToPositiveRectangle(imageBounds);
                hReduction  = horizontalReduction * imageBounds.Width;
                vReduction  = verticalReduction * imageBounds.Height;

                imageBounds = new RectangleF(imageBounds.X + hReduction, imageBounds.Y + vReduction, imageBounds.Width - 2 * hReduction, imageBounds.Height - 2 * vReduction);
                return(Rectangle.Round(RectangleUtilities.Intersect(imageBounds, clientBounds)));
            }
            else
            {
                return(Rectangle.Round(clientBounds));
            }
        }
        private void InitializeSceneGraph(
            ImageGraphic imageGraphic,
            double pixelSpacingX,
            double pixelSpacingY,
            double pixelAspectRatioX,
            double pixelAspectRatioY)
        {
            _imageGraphic = imageGraphic;

            _compositeImageGraphic = new CompositeImageGraphic(
                imageGraphic.Rows,
                imageGraphic.Columns,
                pixelSpacingX,
                pixelSpacingY,
                pixelAspectRatioX,
                pixelAspectRatioY);

            _applicationGraphics      = new CompositeGraphic();
            _applicationGraphics.Name = "Application";

            _overlayGraphics      = new CompositeGraphic();
            _overlayGraphics.Name = "Overlay";

            _presentationStateGraphic      = new PresentationStateGraphic();
            _presentationStateGraphic.Name = "PresentationState";

            _compositeImageGraphic.Graphics.Add(_imageGraphic);
            _compositeImageGraphic.Graphics.Add(_applicationGraphics);
            _compositeImageGraphic.Graphics.Add(_overlayGraphics);

            this.SceneGraph.Graphics.Add(_presentationStateGraphic);
            this.SceneGraph.Graphics.Add(_compositeImageGraphic);
        }
Example #5
0
        public void Apply()
        {
            if (this.SelectedImageGraphicProvider == null)
            {
                return;
            }

            ImageGraphic image = this.SelectedImageGraphicProvider.ImageGraphic;

            if (image == null)
            {
                return;
            }

            if (!(image is GrayscaleImageGraphic))
            {
                return;
            }

            // explicitly unload the (filtered) pixel data for the frame
            this.SelectedImageSopProvider.Frame.UnloadPixelData();

            // now draw the frame again - since we unloaded the filtered pixel data, it will reload from the original source
            image.Draw();
        }
        public LoadingScreen(string picturePath, Vector2 pictureSize)
        {
            Background = new ImageGraphic
            {
                Texture = new TextureFromFile("Interface/LoadingScreen/background.png"),
                TextureAdressMode = SlimDX.Direct3D9.TextureAddress.Wrap,
            };

            Common.Tuple<string, Vector2> picture;
            if (picturePath != null)
                picture = new Common.Tuple<string, Vector2>(picturePath, pictureSize);
            else
                picture = defaultPictures[new Random().Next(defaultPictures.Length)];

            var picMetaTexture = new TextureFromFile(picture.First) { DontScale = true };
            var pic = new Control
            {
                Background = new ImageGraphic
                {
                    Texture = picMetaTexture,
                    SizeMode = SizeMode.AutoAdjust
                },
                Anchor = Orientation.Center,
                Size = picture.Second
            };

            Dock = System.Windows.Forms.DockStyle.Fill;

            pic.AddChild(progress);
            AddChild(pic);
        }
Example #7
0
        public virtual bool RenderImage(System.IO.MemoryStream ms, out int w, out int h, bool bRotate90 = false)
        {
            int frame = 0;

            if (frame != CurrentFrame || _pixelData == null)
            {
                Load(Dataset, frame);
            }

            var graphic = new ImageGraphic(_pixelData);

            if (ShowOverlays)
            {
                foreach (var overlay in _overlays)
                {
                    if ((frame + 1) < overlay.OriginFrame ||
                        (frame + 1) > (overlay.OriginFrame + overlay.NumberOfFrames - 1))
                    {
                        continue;
                    }

                    var og = new OverlayGraphic(
                        PixelDataFactory.Create(overlay),
                        overlay.OriginX - 1,
                        overlay.OriginY - 1,
                        OverlayColor);
                    graphic.AddOverlay(og);
                    og.Scale(this._scale);
                }
            }

            return(graphic.RenderImage(this._pipeline.LUT, ms, out w, out h, bRotate90));
        }
 public MalariaSign()
 {
     Background = new ImageGraphic
     {
         Texture = new TextureFromFile("Interface/IngameInterface/Malaria1.png")
         {
             DontScale = true
         },
     };
     Size          = new Vector2(600, 300);
     Anchor        = Orientation.Bottom;
     Position      = new Vector2(0, 50);
     Updateable    = true;
     AddChild(text = new Label
     {
         Font = new Font
         {
             Color      = System.Drawing.Color.FromArgb(255, 0x8a, 0xdf, 0x39),
             Backdrop   = System.Drawing.Color.FromArgb(100, 0, 0, 0),
             SystemFont = Fonts.HugeSystemFont
         },
         Text       = Locale.Resource.HUDMalaria,
         Background = null,
         TextAnchor = Orientation.Center,
         Dock       = System.Windows.Forms.DockStyle.Fill,
         Clickable  = false,
     });
 }
Example #9
0
        /// <summary>Renders DICOM image to <see cref="IImage"/>.</summary>
        /// <param name="frame">Zero indexed frame number</param>
        /// <returns>Rendered image</returns>
        public virtual IImage RenderImage(int frame = 0)
        {
            if (frame != CurrentFrame || _pixelData == null)
            {
                Load(Dataset, frame);
            }

            var graphic = new ImageGraphic(_pixelData);

            if (ShowOverlays)
            {
                foreach (var overlay in _overlays)
                {
                    if ((frame + 1) < overlay.OriginFrame ||
                        (frame + 1) > (overlay.OriginFrame + overlay.NumberOfFrames - 1))
                    {
                        continue;
                    }

                    var og = new OverlayGraphic(
                        PixelDataFactory.Create(overlay),
                        overlay.OriginX - 1,
                        overlay.OriginY - 1,
                        OverlayColor);
                    graphic.AddOverlay(og);
                    og.Scale(this._scale);
                }
            }

            return(graphic.RenderImage(this._pipeline.LUT));
        }
        protected override void OnConstruct()
        {
            ImageGraphic left, middle, right;
            SetGraphic("LeftBackground", left = new ImageGraphic
            {
                Texture = new TextureFromFile(backgroundLeft) { DontScale = true },
                SizeMode = SizeMode.AutoAdjust,
                Position = backgroundOffset,
            });
            SetGraphic("MiddleBackground", middle = new ImageGraphic
            {
                Texture = new TextureFromFile(backgroundMiddle) { DontScale = true },
                Position = new Vector3(backgroundLeftSize, 0, 0) + backgroundOffset,
                TextureAdressMode = SlimDX.Direct3D9.TextureAddress.Wrap,
            });
            SetGraphic("RightBackground", right = new ImageGraphic
            {
                Texture = new TextureFromFile(backgroundRight) { DontScale = true },
                SizeMode = SizeMode.AutoAdjust
            });

            base.OnConstruct();
            if (MouseState == global::Graphics.MouseState.Down && !Disabled)
                Caption.Position = new Vector3(1, 1, 0) + Common.Math.ToVector3(InnerOffset);
            else
                Caption.Position = Common.Math.ToVector3(InnerOffset);
            middle.Size = new Vector2(Size.X - backgroundLeftSize - backgroundRightPadding - 2 * backgroundOffset.X, backgroundHeight);
            right.Position = new Vector3(Size.X - backgroundRightSize - 2 * backgroundOffset.X, 0, 0) + backgroundOffset;
        }
        private static Bitmap DrawCompleteImageToBitmap(IPresentationImage image, float scale, float dpi)
        {
            ImageSpatialTransform transform = (ImageSpatialTransform)((ISpatialTransformProvider)image).SpatialTransform;
            object restoreMemento           = transform.CreateMemento();

            try
            {
                ImageGraphic imageGraphic   = ((IImageGraphicProvider)image).ImageGraphic;
                Rectangle    imageRectangle = new Rectangle(0, 0, imageGraphic.Columns, imageGraphic.Rows);

                transform.Initialize();
                transform.ScaleToFit = false;
                transform.Scale      = scale;
                RectangleF displayRectangle = imageGraphic.SpatialTransform.ConvertToDestination(imageRectangle);
                int        width            = (int)Math.Round(displayRectangle.Width);
                int        height           = (int)Math.Round(displayRectangle.Height);

                transform.ScaleToFit = true;
                return(ImageDrawToBitmap(image, width, height, dpi));
            }
            finally
            {
                transform.SetMemento(restoreMemento);
            }
        }
        protected override void OnConstruct()
        {
            Background = new ImageGraphic
            {
                Texture = new TextureFromFile("Interface/IngameInterface/Stage" +
                                              (Completed ? "Complete" : "") +
                                              (Active ? "Active" : "") +
                                              "1.png")
                {
                    DontScale = true
                },
            };

            base.OnConstruct();
            if (Active)
            {
                title.Font.Color = System.Drawing.Color.White;
            }
            else if (Completed)
            {
                title.Font.Color = System.Drawing.Color.Gold;
            }
            else
            {
                title.Font.Color = System.Drawing.Color.Gray;
            }
        }
Example #13
0
        void IProbe.Probe(PointF coordinate, CoordinateSystem coordinateSystem)
        {
            if (Context.Viewer.SelectedTile == null)
            {
                throw new InvalidOperationException("No tile selected.");
            }

            if (SelectedPresentationImage == null)
            {
                throw new InvalidOperationException("No image selected.");
            }

            if (SelectedSpatialTransformProvider == null)
            {
                throw new InvalidOperationException("Unsupported image type selected.");
            }

            if (coordinateSystem == CoordinateSystem.Destination)
            {
                coordinate = SelectedSpatialTransformProvider.SpatialTransform.ConvertToSource(coordinate);
            }

            _selectedTile = (Tile)Context.Viewer.SelectedTile;
            _selectedTile.InformationBox = new InformationBox();
            _selectedImageGraphic        = SelectedImageGraphicProvider != null ? SelectedImageGraphicProvider.ImageGraphic : null;
            _selectedSpatialTransform    = SelectedSpatialTransformProvider.SpatialTransform;
            _selectedFrame             = ((IImageSopProvider)SelectedPresentationImage).Frame;
            _selectedCoordinateMapping = SelectedPresentationImage is IPatientCoordinateMappingProvider ? ((IPatientCoordinateMappingProvider)SelectedPresentationImage).PatientCoordinateMapping : null;

            Probe(Point.Truncate(coordinate), true, true);
        }
 private static MammographyImageSpatialTransform CreateTransform(ImageGraphic imageGraphic, string rowDirection, string colDirection, string laterality, Rectangle clientRect)
 {
     return(new MammographyImageSpatialTransform(imageGraphic, imageGraphic.Rows, imageGraphic.Columns, 0.5, 0.5, 1, 1, new PatientOrientation(rowDirection, colDirection), laterality)
     {
         ClientRectangle = clientRect, Scale = 1, ScaleToFit = false
     });
 }
 public RageLevelXPopupText()
 {
     Background = new ImageGraphic
     {
         Texture = new TextureFromFile("Interface/IngameInterface/RageLevel1.png")
         {
             DontScale = true
         },
         Position = new Vector3(0, -57, 0)
     };
     Clickable  = false;
     Overflow   = global::Graphics.TextOverflow.Ignore;
     Anchor     = global::Graphics.Orientation.Bottom;
     Position   = new Vector2(0, 10);
     TextAnchor = global::Graphics.Orientation.Center;
     Size       = new Vector2(646, 415);
     Font       = new Graphics.Content.Font
     {
         Backdrop   = System.Drawing.Color.Transparent,
         Color      = System.Drawing.Color.FromArgb(255, 0xff, 0x5d, 0x0e),
         SystemFont = Fonts.HugeSystemFont
     };
     DisplayTime = 3;
     Updateable  = true;
 }
        private static Statistics RenderAndDiff(ImageGraphic control, ImageGraphic test, string controlName, string testName)
        {
            List <int> diffs = new List <int>();

            using (Bitmap controlBitmap = new Bitmap(control.Columns, control.Rows))
            {
                using (Bitmap testBitmap = Render(test))
                {
                    for (int x = 0; x < control.Columns; x++)
                    {
                        for (int y = 0; y < control.Rows; y++)
                        {
                            if (control is ColorImageGraphic)
                            {
                                Color controlColor = Color.FromArgb(control.PixelData.GetPixel(x, y));
                                Color testColor    = testBitmap.GetPixel(x, y);

                                diffs.Add(Math.Abs(controlColor.R - testColor.R));
                                diffs.Add(Math.Abs(controlColor.G - testColor.G));
                                diffs.Add(Math.Abs(controlColor.B - testColor.B));

                                controlBitmap.SetPixel(x, y, controlColor);
                            }
                            else if (control is GrayscaleImageGraphic)
                            {
                                int range  = 1 << ((GrayscaleImageGraphic)control).BitsStored;
                                int offset = ((GrayscaleImageGraphic)control).IsSigned ? -(range >> 1) : 0;
                                int v      = (int)(256f * (control.PixelData.GetPixel(x, y) - offset) / range);

                                Color controlColor = Color.FromArgb(255, v, v, v);
                                Color testColor    = testBitmap.GetPixel(x, y);

                                diffs.Add(Math.Abs(controlColor.R - testColor.R));
                                diffs.Add(Math.Abs(controlColor.G - testColor.G));
                                diffs.Add(Math.Abs(controlColor.B - testColor.B));

                                controlBitmap.SetPixel(x, y, controlColor);
                            }
                            else
                            {
                                Assert.Ignore("Unable to render and diff images of type {0}", control.GetType().FullName);
                            }
                        }
                    }

                    if (!string.IsNullOrEmpty(testName))
                    {
                        testBitmap.Save(testName);
                    }
                }

                if (!string.IsNullOrEmpty(controlName))
                {
                    controlBitmap.Save(controlName);
                }
            }

            return(new Statistics(diffs));
        }
Example #17
0
        /// <summary>Renders DICOM image to <see cref="IImage"/>.</summary>
        /// <param name="frame">Zero indexed frame number.</param>
        /// <returns>Rendered image</returns>
        public virtual IImage RenderImage(int frame = 0)
        {
            IPixelData pixels;

            lock (_lock)
            {
                var load = frame >= 0 && (frame != CurrentFrame || _rerender);
                CurrentFrame = frame;
                _rerender    = false;

                if (load)
                {
                    var frameIndex = GetFrameIndex(frame);
                    pixels  = PixelDataFactory.Create(_pixelData, frameIndex).Rescale(_scale);
                    _pixels = pixels;
                }
                else
                {
                    pixels = _pixels;
                }
            }

            if (ShowOverlays)
            {
                EstablishGraphicsOverlays();
            }

            IImage image;
            var    graphic = new ImageGraphic(pixels);

            if (ShowOverlays)
            {
                foreach (var overlay in _overlays)
                {
                    if (overlay.Data is EmptyBuffer)//fixed overlay.data is null, exception thrown
                    {
                        continue;
                    }

                    if (frame + 1 < overlay.OriginFrame ||
                        frame + 1 > overlay.OriginFrame + overlay.NumberOfFrames - 1)
                    {
                        continue;
                    }

                    var og = new OverlayGraphic(
                        PixelDataFactory.Create(overlay),
                        overlay.OriginX - 1,
                        overlay.OriginY - 1,
                        OverlayColor);
                    graphic.AddOverlay(og);
                    og.Scale(_scale);
                }
            }

            image = graphic.RenderImage(_pipeline.LUT);

            return(image);
        }
Example #18
0
        public static void Render(
            ImageGraphic imageGraphic,
            IntPtr pDstPixelData,
            int dstWidth,
            int dstBytesPerPixel,
            Rectangle clientRectangle)
        {
            if (clientRectangle.Width <= 0 || clientRectangle.Height <= 0)
            {
                return;
            }

            if (imageGraphic.SizeInBytes != imageGraphic.PixelData.Raw.Length)
            {
                throw new InvalidOperationException(String.Format(SR.ExceptionIncorrectPixelDataSize, imageGraphic.SizeInBytes, imageGraphic.PixelData.Raw.Length));
            }

#if DEBUG
            CodeClock clock = new CodeClock();
            clock.Start();
#endif
            RectangleF srcViewableRectangle;
            Rectangle  dstViewableRectangle;

            CalculateVisibleRectangles(imageGraphic, clientRectangle, out dstViewableRectangle, out srcViewableRectangle);

            var grayGraphic = imageGraphic as GrayscaleImageGraphic;
            ColorImageGraphic colorGraphic;
            if (grayGraphic != null)
            {
                RenderGrayscale(
                    grayGraphic,
                    srcViewableRectangle,
                    dstViewableRectangle,
                    pDstPixelData,
                    dstWidth,
                    dstBytesPerPixel);
            }
            else if (null != (colorGraphic = imageGraphic as ColorImageGraphic))
            {
                RenderColor(
                    colorGraphic,
                    srcViewableRectangle,
                    dstViewableRectangle,
                    pDstPixelData,
                    dstWidth,
                    dstBytesPerPixel);
            }
            else
            {
                throw new Exception("Unknown ImageGraphic.");
            }
#if DEBUG
            clock.Stop();
            PerformanceReportBroker.PublishReport("ImageRenderer", "Render", clock.Seconds);
#endif
        }
Example #19
0
        /// <summary>Renders DICOM image to <see cref="IImage"/>.</summary>
        /// <param name="frame">Zero indexed frame number.</param>
        /// <returns>Rendered image</returns>
        public virtual IImage RenderImage(int frame = 0)
        {
            bool load;

            lock (_lock)
            {
                load          = frame >= 0 && (frame != CurrentFrame || _rerender);
                _currentFrame = frame;
                _rerender     = false;
            }

            var frameIndex = GetFrameIndex(frame);

            if (load)
            {
                lock (_lock)
                {
                    _pixels = PixelDataFactory.Create(_pixelData, frameIndex).Rescale(_scale);
                }
            }

            if (ShowOverlays)
            {
                EstablishGraphicsOverlays();
            }

            IImage image;

            lock (_lock)
            {
                var graphic = new ImageGraphic(_pixels);

                if (ShowOverlays)
                {
                    foreach (var overlay in _overlays)
                    {
                        if (frame + 1 < overlay.OriginFrame ||
                            frame + 1 > overlay.OriginFrame + overlay.NumberOfFrames - 1)
                        {
                            continue;
                        }

                        var og = new OverlayGraphic(
                            PixelDataFactory.Create(overlay),
                            overlay.OriginX - 1,
                            overlay.OriginY - 1,
                            OverlayColor);
                        graphic.AddOverlay(og);
                        og.Scale(_scale);
                    }
                }

                image = graphic.RenderImage(_pipeline.LUT);
            }

            return(image);
        }
Example #20
0
 public TakesDamageEffect()
 {
     Background = new ImageGraphic
     {
         Texture = new TextureFromFile("Interface/IngameInterface/Wounded1.png"),
         Size    = new Vector2(128, 128)
     };
     Size       = new Vector2(102, 102);
     Updateable = true;
 }
 public GameLogoImage()
 {
     Background = new ImageGraphic
     {
         Texture = new TextureFromFile("Interface/Menu/GameLogo3.png") { DontScale = true },
         //Alpha = 0.9f
     };
     //Size = new Vector2(712, 249);
     Size = new Vector2(1000, 421);
 }
Example #22
0
		public ImageSource RenderImageSource() {
			ImageGraphic graphic = new ImageGraphic(_pixelData);

			foreach (var overlay in _overlays) {
				OverlayGraphic og = new OverlayGraphic(PixelDataFactory.Create(overlay), overlay.OriginX, overlay.OriginY, OverlayColor);
				graphic.AddOverlay(og);
			}

			return graphic.RenderImageSource(_pipeline.LUT);
		}
 public AchievementsMenu()
 {
     Size = new Vector2(465, 762);
     Background = new ImageGraphic
     {
         Texture = new TextureFromFile("Interface/Menu/Achievements1.png") { DontScale = true },
         SizeMode = SizeMode.AutoAdjust,
         Position = new Vector3(-27, -28, 0)
     };
 }
Example #24
0
        public void TestRotationConstraints()
        {
            SynchronizationContext oldContext = SynchronizationContext.Current;

            if (oldContext == null)
            {
                SynchronizationContext.SetSynchronizationContext(new SynchronizationContext());
            }
            try
            {
                CompositeGraphic      sceneGraph     = CreateTestSceneGraph();
                CompositeImageGraphic imageComposite = (CompositeImageGraphic)sceneGraph.Graphics[0];
                ImageGraphic          image          = (ImageGraphic)imageComposite.Graphics[0];
                CompositeGraphic      primitiveOwner = (CompositeGraphic)imageComposite.Graphics[1];
                Graphic primitive = (Graphic)primitiveOwner.Graphics[0];

                RoiGraphic roiGraphic = (RoiGraphic)imageComposite.Graphics[2];

                try
                {
                    sceneGraph.SpatialTransform.RotationXY     = 90;
                    imageComposite.SpatialTransform.RotationXY = 90;
                    primitiveOwner.SpatialTransform.RotationXY = 10;
                    primitive.SpatialTransform.RotationXY      = -20;
                }
                catch (Exception)
                {
                    Assert.Fail("These operations should not throw an exception!");
                }

                Matrix cumulativeTransform;
                try
                {
                    imageComposite.SpatialTransform.RotationXY = 30;
                    //should throw; no non-90 degree rotations allowed on an image
                    cumulativeTransform = image.SpatialTransform.CumulativeTransform;
                    Assert.Fail("expected exception not thrown!");
                }
                catch (ArgumentException)
                {
                    imageComposite.SpatialTransform.RotationXY = 90;
                }

                roiGraphic.SpatialTransform.RotationXY = 100;
                //should throw; no rotation allowed on a roi
                cumulativeTransform = roiGraphic.SpatialTransform.CumulativeTransform;
            }
            finally
            {
                if (oldContext != SynchronizationContext.Current)
                {
                    SynchronizationContext.SetSynchronizationContext(oldContext);
                }
            }
        }
Example #25
0
 public GameLogoChallengeImage()
 {
     Background = new ImageGraphic
     {
         Texture = new TextureFromFile("Interface/Menu/GameLogo.png")
         {
             DontScale = true
         },
         //Alpha = 0.9f
     };
     Size = new Vector2(712, 249);
 }
        public static Bitmap RenderLayer(ImageGraphic layer, int dstWidth, int dstHeight)
        {
            Bitmap    bitmap     = new Bitmap(dstWidth, dstHeight);
            Rectangle clientArea = new Rectangle(0, 0, dstWidth, dstHeight);

            BitmapData bitmapData    = LockBitmap(bitmap);
            int        bytesPerPixel = 4;

            ImageRenderer.Render(layer, bitmapData.Scan0, bitmapData.Width, bytesPerPixel, clientArea);
            bitmap.UnlockBits(bitmapData);
            return(bitmap);
        }
Example #27
0
        /// <summary>Renders DICOM image to System.Drawing.Image</summary>
        /// <returns>Rendered image</returns>
#if !SILVERLIGHT
        public Image RenderImage(Double resize = 0)
        {
            ImageGraphic graphic = new ImageGraphic(_pixelData, resize);

            foreach (var overlay in _overlays)
            {
                OverlayGraphic og = new OverlayGraphic(PixelDataFactory.Create(overlay), overlay.OriginX, overlay.OriginY, OverlayColor);
                graphic.AddOverlay(og);
            }

            return(graphic.RenderImage(_pipeline.LUT));
        }
Example #28
0
        public void Apply()
        {
            if (this.SelectedImageGraphicProvider == null)
            {
                return;
            }

            ImageGraphic image = this.SelectedImageGraphicProvider.ImageGraphic;

            if (image == null)
            {
                return;
            }

            if (!(image is GrayscaleImageGraphic))
            {
                return;
            }

            itkImageBase input  = ItkHelper.CreateItkImage(image as GrayscaleImageGraphic);
            itkImageBase output = itkImage.New(input);

            ItkHelper.CopyToItkImage(image as GrayscaleImageGraphic, input);

            FilterType filter = FilterType.New(input, output);

            filter.SetInput(input);

            String mangledType = input.MangledTypeString;
            intensityFilterType intensityFilter = intensityFilterType.New(mangledType + mangledType);

            intensityFilter.SetInput(filter.GetOutput());
            intensityFilter.OutputMinimum = 0;
            if (image.BitsPerPixel == 16)
            {
                intensityFilter.OutputMaximum = 32767;
            }
            else
            {
                intensityFilter.OutputMaximum = 255;
            }
            intensityFilter.Update();

            intensityFilter.GetOutput(output);
            ItkHelper.CopyFromItkImage(image as GrayscaleImageGraphic, output);
            image.Draw();

            filter.Dispose();
            intensityFilter.Dispose();
            input.Dispose();
            output.Dispose();
        }
 public Window()
 {
     Size       = new Vector2(0, 200);
     Background = new ImageGraphic
     {
         Texture = new TextureConcretizer {
             TextureDescription =
                 new global::Graphics.Software.Textures.SingleColorTexture(
                     System.Drawing.Color.FromArgb(178, 0, 0, 0))
         }
     };
     Padding = new System.Windows.Forms.Padding(10, 20, 10, 20);
 }
Example #30
0
        public override void Cancel()
        {
            if (_selectedTile == null || _selectedImageGraphic == null)
            {
                return;
            }

            _selectedImageGraphic = null;

            _selectedTile.InformationBox.Visible = false;
            _selectedTile.InformationBox         = null;
            _selectedTile = null;
        }
        protected void SerializeDisplayedArea(DisplayedAreaModuleIod displayedAreaModule, DicomPresentationImageCollection <T> images)
        {
            displayedAreaModule.InitializeAttributes();
            List <DisplayedAreaModuleIod.DisplayedAreaSelectionSequenceItem> displayedAreas = new List <DisplayedAreaModuleIod.DisplayedAreaSelectionSequenceItem>();

            foreach (T image in images)
            {
                DisplayedAreaModuleIod.DisplayedAreaSelectionSequenceItem displayedArea = new DisplayedAreaModuleIod.DisplayedAreaSelectionSequenceItem();
                displayedArea.InitializeAttributes();
                displayedArea.ReferencedImageSequence = new[] { CreateImageSopInstanceReference(image.Frame) };

                ImageGraphic imageGraphic = ((IImageGraphicProvider)image).ImageGraphic;
                Size         imageSize    = new Size(imageGraphic.Columns, imageGraphic.Rows);

                // compute the visible area of the image as a rectangle oriented positively in screen space
                RectangleF visibleImageArea = imageGraphic.SpatialTransform.ConvertToSource(image.ClientRectangle);
                visibleImageArea = RectangleUtilities.ConvertToPositiveRectangle(visibleImageArea);
                visibleImageArea = RectangleUtilities.RoundInflate(visibleImageArea);
                visibleImageArea = RectangleUtilities.Intersect(visibleImageArea, new Rectangle(new Point(0, 0), imageSize));

                // compute the pixel addresses of the visible area by intersecting area with actual pixel addresses available
                Rectangle visiblePixels = ConvertToPixelAddressRectangle(Rectangle.Truncate(visibleImageArea));
                displayedArea.DisplayedAreaTopLeftHandCorner     = visiblePixels.Location;
                displayedArea.DisplayedAreaBottomRightHandCorner = visiblePixels.Location + visiblePixels.Size;

                ISpatialTransform spatialTransform = image.SpatialTransform;
                switch (_displayAreaSerializationOption)
                {
                case DisplayAreaSerializationOption.SerializeAsMagnification:
                    displayedArea.PresentationSizeMode = DisplayedAreaModuleIod.PresentationSizeMode.Magnify;
                    displayedArea.PresentationPixelMagnificationRatio = spatialTransform.Scale;
                    break;

                case DisplayAreaSerializationOption.SerializeAsTrueSize:
                    displayedArea.PresentationSizeMode     = DisplayedAreaModuleIod.PresentationSizeMode.TrueSize;
                    displayedArea.PresentationPixelSpacing = image.Frame.NormalizedPixelSpacing;
                    break;

                case DisplayAreaSerializationOption.SerializeAsDisplayedArea:
                default:
                    displayedArea.PresentationSizeMode = DisplayedAreaModuleIod.PresentationSizeMode.ScaleToFit;
                    break;
                }

                displayedArea.PresentationPixelAspectRatio = PixelAspectRatio.FromString(image.Frame.NormalizedPixelSpacing.GetPixelAspectRatioString());

                displayedAreas.Add(displayedArea);
            }
            displayedAreaModule.DisplayedAreaSelectionSequence = displayedAreas.ToArray();
        }
Example #32
0
        /// <summary>
        /// Draws an <see cref="ImageGraphic"/>.
        /// </summary>
        protected override void DrawImageGraphic(ImageGraphic imageGraphic)
        {
            CodeClock clock = new CodeClock();

            clock.Start();

            Surface.ImageBuffer.Graphics.Clear(Color.FromArgb(0x0, 0xFF, 0xFF, 0xFF));

            DrawImageGraphic(Surface.ImageBuffer, imageGraphic);

            Surface.FinalBuffer.RenderImage(Surface.ImageBuffer);

            clock.Stop();
            PerformanceReportBroker.PublishReport("GDIRenderer", "DrawImageGraphic", clock.Seconds);
        }
Example #33
0
        public override void Cancel()
        {
            if (_selectedTile == null || _selectedSpatialTransform == null)
            {
                return;
            }

            _selectedImageGraphic                = null;
            _selectedSpatialTransform            = null;
            _selectedFrame                       = null;
            _selectedCoordinateMapping           = null;
            _selectedTile.InformationBox.Visible = false;
            _selectedTile.InformationBox         = null;
            _selectedTile = null;
        }
        public StoneDropDownBar()
        {
            Size       = new Vector2(243, 28);
            Padding    = new System.Windows.Forms.Padding(1, 1, 25, 1);
            Background = new ImageGraphic
            {
                SizeMode = SizeMode.AutoAdjust
            };

            if (Disabled)
            {
                NormalTexture = new TextureFromFile("Interface/Common/DropdownInactive1.png")
                {
                    DontScale = true
                }
            }
            ;
            else
            {
                NormalTexture = new TextureFromFile("Interface/Common/Dropdown1.png")
                {
                    DontScale = true
                }
            };

            HoverTexture = new TextureFromFile("Interface/Common/DropdownMouseOver1.png")
            {
                DontScale = true
            };
            ClickTexture = new TextureFromFile("Interface/Common/DropdownMouseOver1.png")
            {
                DontScale = true
            };
            Font = new Font
            {
                SystemFont = Fonts.MediumSystemFont,
                Color      = System.Drawing.Color.White
            };
            DropDownBackground = //InterfaceScene.DefaultSlimBorder;
                                 new StretchingImageGraphic
            {
                Texture = new TextureConcretizer
                {
                    TextureDescription = new global::Graphics.Software.Textures.SingleColorTexture(
                        System.Drawing.Color.FromArgb(220, 0, 0, 0))
                }
            };
        }
        public WorldMapControl()
        {
            Moveable = true;
            ControlBox = false;
            Size = new Vector2(100000, 100000);
            var res = Program.Instance.GraphicsDevice.Settings.Resolution;
            Position = new Vector2(-Size.X / 2f + res.Width / 2f, -Size.Y / 2f + res.Height / 2f);
            Background = new ImageGraphic
            {
                Texture = new TextureFromFile("Interface/Menu/MapBackground1.png"),
                Size = new Vector2(2000, 2000),
                TextureAdressMode = SlimDX.Direct3D9.TextureAddress.Wrap
            };

            //Form center = new Form
            //{
            //    Size = new Vector2(20, 20),
            //    Anchor = Orientation.Center
            //};
            //AddChild(center);

            Control innerWorld = new Control
            {
                Size = new Vector2(50, 50),
                Position = new Vector2(Size.X/2f, Size.Y / 2f)
            };
            AddChild(innerWorld);

            innerWorld.AddChild(new WorldMapSelectMapControl
            {
                Position = new Vector2(-1000, -1000)
            });
            innerWorld.AddChild(new Control
            {
                Background = new ImageGraphic
                {
                    Texture = new TextureFromFile("Interface/Menu/MapTexture1.png"),
                    Size = new Vector2(5000, 5000),
                    TextureAdressMode = SlimDX.Direct3D9.TextureAddress.Wrap
                },
                Size = new Vector2(5000, 5000),
                Position = new Vector2(-2500, -2500)
            });
            innerWorld.AddChild(new Control
            {
                Position = new Vector2(-550, -180),
                Background = new ImageGraphic
                {
                    Texture = new TextureFromFile("Interface/Menu/GameLogo.png") { DontScale = true },
                    SizeMode = SizeMode.AutoAdjust
                }
            });
            innerWorld.AddChild(new GoldCoinsControl
            {
                Position = new Vector2(-250, 100),
            });
            innerWorld.AddChild(new SilverCoinsControl
            {
                Position = new Vector2(-220, 260),
            });
            innerWorld.AddChild(new WeaponsMenu
            {
                Position = new Vector2(-400, 400),
            });
            innerWorld.AddChild(new AchievementsMenu
            {
                Position = new Vector2(500, 400)
            });
            innerWorld.AddChild(new Control
            {
                Position = new Vector2(-4000, -4000),
                Size = new Vector2(8000, 8000),
                Background = new StretchingImageGraphic
                {
                    Texture = new TextureFromFile("Interface/Menu/MapDimmer1.png"),
                    Size = new Vector2(8000, 8000),
                    TextureUVMin = new Vector2(-0.5f, -0.5f),
                    TextureUVMax = new Vector2(1.5f, 1.5f)
                }
            });
            //Updateable = true;
        }
        public WorldMapSelectMapControl()
        {
            Size = new Vector2(2000, 2000);
            Background = new ImageGraphic
            {
                Texture = new TextureFromFile("Interface/Menu/Map1.png") { DontScale = true },
                SizeMode = SizeMode.AutoAdjust
            };

            var c = Campaign.Campaign1();

            Dictionary<Tier, TierBackgroundControl> backgrounds = new Dictionary<Tier, TierBackgroundControl>();
            foreach (var v in c.Tiers)
            {
                var b = new TierBackgroundControl
                {
                    Tier = v
                };
                AddChild(b);
                backgrounds.Add(v, b);
            }

            AddChild(new Control
            {
                Background = new ImageGraphic
                {
                    Texture = new TextureFromFile("Interface/Menu/Map2.png") { DontScale = true },
                    SizeMode = SizeMode.AutoAdjust
                }
            });

            foreach (var v in c.Tiers)
            {
                AddChild(new TierControl
                {
                    Tier = v,
                    TierBackground = backgrounds[v]
                });
            }
        }
        public GoldCoinsControl()
        {
            Background = new ImageGraphic
            {
                Texture = new TextureFromFile("Interface/Popups/GoldcoinSmall1.png") { DontScale = true },
                SizeMode = SizeMode.AutoAdjust
            };
            Size = new Vector2(230, 160);
            Clickable = true;

            AddChild(pointsTextBox);
        }
        protected override void OnConstruct()
        {
            ClearGraphics();

            SetGraphic("aaMapButton.Flash1", flash1);
            SetGraphic("aaMapButton.Flash2", flash2);

            if (Completed)
            {
                SetGraphic("aaaMapButton.Completed", new ImageGraphic
                {
                    Texture = new TextureFromFile("Interface/Menu/LevelIconWin1.png") { DontScale = true },
                    SizeMode = SizeMode.AutoAdjust,
                    Position = new Vector3(0, 0, 0) + graphicsOffest
                });
            }
            else
            {
                SetGraphic("aaaMapButton.Completed", null);
            }

            if (global::Common.FileSystem.Instance.FileExists(Program.DataPath + "/Interface/Menu/" + Map + "Icon1.png"))
                Background = new ImageGraphic
                {
                    Texture = new TextureFromFile("Interface/Menu/" + Map + "Icon1.png") { DontScale = true },
                    SizeMode = SizeMode.AutoAdjust,
                    Position = new Vector3(0, 0, 0) + graphicsOffest
                };
            else
                Background = new ImageGraphic
                {
                    Texture = new TextureFromFile("Interface/Menu/LevelIconUnlocked.png") { DontScale = true },
                    SizeMode = SizeMode.AutoAdjust,
                    Position = new Vector3(0, 0, 0) + graphicsOffest
                };

            base.OnConstruct();
            if (GreyedOut)
            {
                SetGraphic("MapButton.Greyout", new ImageGraphic
                {
                    Texture = new TextureFromFile("Interface/Menu/LevelIconUnlocked.png") { DontScale = true },
                    SizeMode = SizeMode.AutoAdjust,
                    Position = new Vector3(0, 0, 0) + graphicsOffest
                });
            }
            else
            {
                SetGraphic("MapButton.Greyout", null);
            }

            if (MouseState == MouseState.Over)
            {
                SetGraphic("MapButton.MouseOver", new ImageGraphic
                {
                    Texture = new TextureFromFile("Interface/Menu/LevelIconMouseover1.png") { DontScale = true },
                    SizeMode = SizeMode.AutoAdjust,
                    Position = new Vector3(0, 0, 0) + graphicsOffest
                });
            }
            else
                SetGraphic("MapButton.MouseOver", null);
        }
        public SilverCoinsControl()
        {
            Background = new ImageGraphic
            {
                Texture = new TextureFromFile("Interface/Popups/Silver5.png") { DontScale = true },
                SizeMode = SizeMode.AutoAdjust
            };
            Size = new Vector2(180, 100);
            Clickable = true;

            AddChild(pointsTextBox);
        }
        protected override void OnConstruct()
        {
            backgroundLeft = "Interface/Menu/ButtonLeft2.png";
            backgroundMiddle = "Interface/Menu/ButtonMiddle2.png";
            backgroundRight = "Interface/Menu/ButtonRight2.png";
            if (!Disabled)
            {
                if (MouseState == MouseState.Over || Checked)
                {
                    backgroundLeft = "Interface/Menu/ButtonLeftMouseOver2.png";
                    backgroundMiddle = "Interface/Menu/ButtonMiddleMouseOver2.png";
                    backgroundRight = "Interface/Menu/ButtonRightMouseOver2.png";
                }
                else if (MouseState == MouseState.Down)
                {
                    backgroundLeft = "Interface/Menu/ButtonLeftDown2.png";
                    backgroundMiddle = "Interface/Menu/ButtonMiddleDown2.png";
                    backgroundRight = "Interface/Menu/ButtonRightDown2.png";
                }
            }

            ImageGraphic left, middle, right;
            SetGraphic("LeftBackground", left = new ImageGraphic
            {
                Texture = new TextureFromFile(backgroundLeft) { DontScale = true },
                SizeMode = SizeMode.AutoAdjust,
                Position = backgroundOffset,
            });
            SetGraphic("MiddleBackground", middle = new ImageGraphic
            {
                Texture = new TextureFromFile(backgroundMiddle) { DontScale = true },
                Position = new Vector3(backgroundLeftSize, 0, 0) + backgroundOffset,
                TextureAdressMode = SlimDX.Direct3D9.TextureAddress.Wrap,
            });
            SetGraphic("RightBackground", right = new ImageGraphic
            {
                Texture = new TextureFromFile(backgroundRight) { DontScale = true },
                SizeMode = SizeMode.AutoAdjust
            });

            base.OnConstruct();
            if (MouseState == global::Graphics.MouseState.Down && !Disabled)
                Caption.Position = new Vector3(1, 1, 0) + Common.Math.ToVector3(InnerOffset);
            else
                Caption.Position = Common.Math.ToVector3(InnerOffset);
            middle.Size = new Vector2(Size.X - backgroundLeftSize - 10 - 2 * backgroundOffset.X, backgroundHeight);
            right.Position = new Vector3(Size.X - backgroundRightSize - 2 * backgroundOffset.X, 0, 0) + backgroundOffset;
        }
        protected override void OnConstruct()
        {
            SetGraphic("aaaUnlockButton.Flash1", flash1);
            SetGraphic("aaaUnlockButton.Flash2", flash2);

            if (Active)
            {
                if (MouseState == MouseState.Over)
                {
                    Background = new ImageGraphic
                    {
                        Texture = new TextureFromFile("Interface/Menu/UnlockMouseover1.png") { DontScale = true },
                        SizeMode = SizeMode.AutoAdjust,
                        Position = imageOffset
                    };
                }
                else
                {
                    Background = new ImageGraphic
                    {
                        Texture = new TextureFromFile("Interface/Menu/UnlockActive1.png") { DontScale = true },
                        SizeMode = SizeMode.AutoAdjust,
                        Position = imageOffset
                    };
                }
            }
            else
            {
                if (MouseState == MouseState.Over)
                {
                    Background = new ImageGraphic
                    {
                        Texture = new TextureFromFile("Interface/Menu/UnlockInactiveMouseover1.png") { DontScale = true },
                        SizeMode = SizeMode.AutoAdjust,
                        Position = imageOffset
                    };
                }
                else
                {
                    Background = new ImageGraphic
                    {
                        Texture = new TextureFromFile("Interface/Menu/UnlockInactive1.png") { DontScale = true },
                        SizeMode = SizeMode.AutoAdjust,
                        Position = imageOffset
                    };
                }
            }
            base.OnConstruct();
        }
			public TestPresentationImage(ImageGraphic imageGraphic)
				: base(imageGraphic) {}
		private static MammographyImageSpatialTransform CreateTransform(ImageGraphic imageGraphic, string rowDirection, string colDirection, string laterality, Rectangle clientRect)
		{
			return new MammographyImageSpatialTransform(imageGraphic, imageGraphic.Rows, imageGraphic.Columns, 0.5, 0.5, 1, 1, new PatientOrientation(rowDirection, colDirection), laterality) {ClientRectangle = clientRect, Scale = 1, ScaleToFit = false};
		}
        public StoneDropDownBar()
        {
            Size = new Vector2(243, 28);
            Padding = new System.Windows.Forms.Padding(1, 1, 25, 1);
            Background = new ImageGraphic
            {
                SizeMode = SizeMode.AutoAdjust
            };

            if (Disabled)
                NormalTexture = new TextureFromFile("Interface/Common/DropdownInactive1.png") { DontScale = true };
            else
                NormalTexture = new TextureFromFile("Interface/Common/Dropdown1.png") { DontScale = true };

            HoverTexture = new TextureFromFile("Interface/Common/DropdownMouseOver1.png") { DontScale = true };
            ClickTexture = new TextureFromFile("Interface/Common/DropdownMouseOver1.png") { DontScale = true };
            Font = new Font
            {
                SystemFont = Fonts.MediumSystemFont,
                Color = System.Drawing.Color.White
            };
            DropDownBackground = //InterfaceScene.DefaultSlimBorder;
                new StretchingImageGraphic
                {
                    Texture = new TextureConcretizer
                    {
                        TextureDescription = new global::Graphics.Software.Textures.SingleColorTexture(
                            System.Drawing.Color.FromArgb(220, 0, 0, 0))
                    }
                };
        }
        public AchievementUnlockedPopup()
        {
            Anchor = global::Graphics.Orientation.Bottom;
            Background = new ImageGraphic
            {
                SizeMode = SizeMode.AutoAdjust,
                Texture = new TextureFromFile("Interface/Common/Achievement1.png") { DontScale = true },
            };
            Clickable = false;
            Position = new Vector2(-40, 150 * displayedAchievements - 80);

            achievementRemoved += new Action(AchievementUnlockedPopup_achievementRemoved);

            Size = new Vector2(421, 225);
            Updateable = true;

            //AddChild(new Control
            //{
            //    Anchor = global::Graphics.Orientation.Top,
            //    Background = new ImageGraphic
            //    {
            //        SizeMode = SizeMode.AutoAdjust,
            //        Texture = new TextureFromFile("Interface/Common/AchievementTextEng1.png") { DontScale = true }
            //    },
            //    Position = new Vector2(0, 40),
            //    Size = new Vector2(235, 33)
            //});
            AddChild(text);
            AddChild(textDescription);
            //AddChild(new TextBox
            //{
            //    Anchor = global::Graphics.Orientation.Top,
            //    AutoSize = AutoSizeMode.Full,
            //    Background = null,
            //    Clickable = false,
            //    Position = new Vector2(0, 120),
            //    ReadOnly = true,
            //    Text = Description
            //});
            //AddChild(questionMarkArea = new Control
            //{
            //    Anchor = global::Graphics.Orientation.TopLeft,
            //    Clickable = true,
            //    Position = new Vector2(318, 82),
            //    Size = new Vector2(21, 21),
            //});
        }
 public Window()
 {
     Size = new Vector2(0, 200);
     Background = new ImageGraphic
     {
         Texture = new TextureConcretizer { TextureDescription =
         new global::Graphics.Software.Textures.SingleColorTexture(
             System.Drawing.Color.FromArgb(178, 0, 0, 0))
         }
     };
     Padding = new System.Windows.Forms.Padding(10, 20, 10, 20);
 }
 public WeaponsMenu()
 {
     Position = new Vector2(100, 0);
     Size = new Vector2(466, 418);
     Clickable = false;
     Background = new ImageGraphic
     {
         Texture = new TextureFromFile("Interface/Menu/Armory1.png") { DontScale = true },
         SizeMode = SizeMode.AutoAdjust,
         Position = new Vector3(-27, -31, 0)
     };
 }
        protected override void OnConstruct()
        {
            Background = new ImageGraphic
            {
                Texture = new TextureFromFile("Interface/IngameInterface/Stage" +
                    (Completed ? "Complete" : "" ) +
                    (Active ? "Active" : "") +
                    "1.png") { DontScale = true },
            };

            base.OnConstruct();
            if (Active)
                title.Font.Color = System.Drawing.Color.White;
            else if (Completed)
                title.Font.Color = System.Drawing.Color.Gold;
            else
                title.Font.Color = System.Drawing.Color.Gray;
        }
 public CinematicButton()
 {
     Size = new Vector2(83, 52);
     Clickable = true;
     Background = new ImageGraphic
     {
         SizeMode = SizeMode.AutoAdjust,
     };
     NormalTexture = new TextureFromFile("Interface/Menu/CinematicIcon1.png") { DontScale = true };
     HoverTexture = ClickTexture = new TextureFromFile("Interface/Menu/CinematicIconMouseover1.png") { DontScale = true };
 }
 protected override void OnConstruct()
 {
     if (tier.RegionImage != null)
     {
         Background = new ImageGraphic
         {
             Texture = new TextureFromFile(tier.RegionImage) { DontScale = true },
             SizeMode = SizeMode.AutoAdjust,
         };
         if (!tier.IsAvailable(Program.Instance.Profile))
             Background.Alpha = 0;
     }
     base.OnConstruct();
     Position = tier.MenuPosition;
 }
 public MalariaSign()
 {
     Background = new ImageGraphic
     {
         Texture = new TextureFromFile("Interface/IngameInterface/Malaria1.png") { DontScale = true },
     };
     Size = new Vector2(600, 300);
     Anchor = Orientation.Bottom;
     Position = new Vector2(0, 50);
     Updateable = true;
     AddChild(text = new Label
     {
         Font = new Font
         {
             Color = System.Drawing.Color.FromArgb(255, 0x8a, 0xdf, 0x39),
             Backdrop = System.Drawing.Color.FromArgb(100, 0, 0, 0),
             SystemFont = Fonts.HugeSystemFont
         },
         Text = Locale.Resource.HUDMalaria,
         Background = null,
         TextAnchor = Orientation.Center,
         Dock = System.Windows.Forms.DockStyle.Fill,
         Clickable = false,
     });
 }
 public RageLevelXPopupText()
 {
     Background = new ImageGraphic
     {
         Texture = new TextureFromFile("Interface/IngameInterface/RageLevel1.png") { DontScale = true },
         Position = new Vector3(0, -57, 0)
     };
     Clickable = false;
     Overflow = global::Graphics.TextOverflow.Ignore;
     Anchor = global::Graphics.Orientation.Bottom;
     Position = new Vector2(0, 10);
     TextAnchor = global::Graphics.Orientation.Center;
     Size = new Vector2(646, 415);
     Font = new Graphics.Content.Font
     {
         Backdrop = System.Drawing.Color.Transparent,
         Color = System.Drawing.Color.FromArgb(255, 0xff, 0x5d, 0x0e),
         SystemFont = Fonts.HugeSystemFont
     };
     DisplayTime = 3;
     Updateable = true;
 }