What is the correct way to embed images?

2 posts, 0 answers
  1. Pavel
    Pavel avatar
    32 posts
    Member since:
    Sep 2016

    Posted 05 Jan 2017 Link to this post

    I need to add some custom images to the ribbon, and I am wondering what is the best practice method for doing this.

    Here's what I have right now, which is obviously not right. What would be a more elegant approach?


    var templateNameImageBytes = Convert.FromBase64String(@"iVBORw0KGgoAAAAN......"); //truncated
    var templateNameStream = new MemoryStream(templateNameImageBytes);
    var lblTempalteName = new RadLabelElement()
        Text = "Template Name:",
        AutoSize = false,
        Size = new Size(120, 20),
        Image = Image.FromStream(templateNameStream),
        TextImageRelation = TextImageRelation.ImageBeforeText
  2. Dess | Tech Support Engineer, Sr.
    Dess | Tech Support Engineer, Sr.  avatar
    4169 posts

    Posted 09 Jan 2017 Link to this post

    Hello Pavel,

    Thank you for writing.  

    I can suggest you adding the desired images as resources. Thus, you can assign the desired image to the respective RadRibbonBar's element. The following MSDN article is quite useful on this topic: https://msdn.microsoft.com/en-us/library/7k989cfy(v=vs.90).aspx

    I hope this information helps. Should you have further questions I would be glad to help.

    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top