コード例 #1
0
 Image GetWarningIcon(Size size)
 {
     using (Stream stream = AppAssembly.GetManifestResourceStream("CustomAppointmentFlyoutExample.warning.svg")) {
         var paletteProvider = SvgPaletteHelper.GetSvgPalette(schedulerControl1.LookAndFeel, ObjectState.Selected);
         return(SvgBitmap.FromStream(stream).Render(size, paletteProvider));
     }
 }
コード例 #2
0
        public static Image CreateImageFromSvg(ISkinProvider skinProvider, string rootPath, string imageName, Size imageSize)
        {
            var       assembly = typeof(MainForm).Assembly;
            SvgBitmap svgBitmap;
            var       stream = assembly.GetManifestResourceStream(rootPath + imageName);

            if (stream == null)
            {
                stream = assembly.GetManifestResourceStream(imageName);
            }
            if (stream == null)
            {
                return(null);
            }
            using (stream) {
                svgBitmap = SvgBitmap.FromStream(stream);
            }
            if (svgBitmap == null)
            {
                return(null);
            }
            var pallete = SvgPaletteHelper.GetSvgPalette(skinProvider, DevExpress.Utils.Drawing.ObjectState.Normal);

            return(svgBitmap.Render(imageSize, pallete));
        }
コード例 #3
0
        public GoogleSigninButton()
        {
            InitializeComponent();
            var assembly = Assembly.GetExecutingAssembly();

            _normal  = SvgBitmap.FromStream(assembly.GetManifestResourceStream(@"Resources/Images/btn_google_light_normal_ios.svg"));
            _hover   = SvgBitmap.FromStream(assembly.GetManifestResourceStream(@"Resources/Images/btn_google_light_focus_ios.svg"));
            _pressed = SvgBitmap.FromStream(assembly.GetManifestResourceStream(@"Resources/Images/btn_google_light_pressed_ios.svg"));

            Logo.Image = _normal.Render(null, 1);
        }
コード例 #4
0
        public static Image CreateCheckBadge(Color color)
        {
            var       assembly = typeof(KanbanHelper).Assembly;
            SvgBitmap svgBitmap;

            using (var stream = ResourceImageHelper.FindStream("DevExpress.XtraGrid.Demos.Images.CheckImage.svg", typeof(KanbanHelper).Assembly)) {
                svgBitmap = SvgBitmap.FromStream(stream);
            }
            if (svgBitmap == null)
            {
                return(null);
            }
            var pallet = new SvgPalette();

            pallet.Colors.Add(new SvgColor("Black", color));
            return(svgBitmap.Render(pallet));
        }