This is a migrated thread and some comments may be shown as answers.

What is the correct way to embed images?

1 Answer 39 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Pavel
Top achievements
Rank 1
Pavel asked on 05 Jan 2017, 09:47 PM

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
};

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 09 Jan 2017, 09:52 AM
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.

Regards,
Dess
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.
Tags
General Discussions
Asked by
Pavel
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or