void DesignMdiController_DesignPanelLoaded(object sender, DevExpress.XtraReports.UserDesigner.DesignerLoadedEventArgs e) { XRToolboxService ts = (XRToolboxService)e.DesignerHost.GetService(typeof(IToolboxService)); ts.AddToolboxItem(new ToolboxItem(typeof(MyCustomLabel)), "Standard Controls"); // change icon of the XRLabel control if (radioGroup1.SelectedIndex == 1) { Stream stream = typeof(CustomLabel.MyCustomLabel).Assembly.GetManifestResourceStream("CustomLabel.StandardLabel.svg"); SvgImage svg = SvgImage.FromStream(stream); ts.AddToolBoxSvgImage(typeof(XRLabel), svg); } else { Stream stream = typeof(CustomLabel.MyCustomLabel).Assembly.GetManifestResourceStream("CustomLabel.StandardLabel16.bmp"); Image img = Image.FromStream(stream); ts.AddToolBoxImage(typeof(XRLabel), ImageSize.Size16, img); stream = typeof(CustomLabel.MyCustomLabel).Assembly.GetManifestResourceStream("CustomLabel.StandardLabel24.bmp"); img = Image.FromStream(stream); ts.AddToolBoxImage(typeof(XRLabel), ImageSize.Size24, img); stream = typeof(CustomLabel.MyCustomLabel).Assembly.GetManifestResourceStream("CustomLabel.StandardLabel32.bmp"); img = Image.FromStream(stream); ts.AddToolBoxImage(typeof(XRLabel), ImageSize.Size32, img); } }
private void LoadSplashImageFromResource() { Assembly assembly = Assembly.GetExecutingAssembly(); Stream svgStream = assembly.GetManifestResourceStream(assembly.GetName().Name + ".Images.SplashScreenImage.svg"); svgStream.Position = 0; pictureEdit2.SvgImage = SvgImage.FromStream(svgStream); }
private void LoadBlankLogo() { Assembly assembly = Assembly.GetExecutingAssembly(); string blankLogoResourceName = assembly.GetName().Name + ".Images.Logo.svg"; Stream svgStream = assembly.GetManifestResourceStream(blankLogoResourceName); if (svgStream != null) { svgStream.Position = 0; peLogo.SvgImage = SvgImage.FromStream(svgStream); } }
public static SvgImage GetSvgImageFromBinary(System.Data.Linq.Binary binary) { if (binary == null) { return(null); } SvgImage returnImage = null; using (MemoryStream ms = new MemoryStream(binary.ToArray())) { try { returnImage = SvgImage.FromStream(ms); } catch { returnImage = null; } } return(returnImage); }
SvgImage GetImage() { string path = "CustomWizardExample.Wizard.Images.XmlBinding.svg"; return(SvgImage.FromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream(path))); }