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

Exporting images from default themes

5 Answers 112 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
Miguel
Top achievements
Rank 1
Miguel asked on 21 Nov 2012, 02:03 AM
Hi,

I'm working on a project where the designers want a purple shade to selected items. The Office2010Silver theme is quite close to what they want, but I would have to change some elements to purple.

At first, I thought the "AddColorBlend" was the way to go, but it seems that color blending is no longer supported.

I can always edit the repository items one by one and change to purple equivalents where necessary, but I've run into some trouble with the images, as I found no way to export the images in an existing theme.

Is there a way to export a image from a theme, or copy it to the clipboard, so that the hue is changes in an external app?

Thanks,
Miguel

5 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 22 Nov 2012, 04:53 PM
Hello Miguel,

Presently, the color blending feature is not available and the easiest way to modify your theme is by using the Visual Style Builder. We plan to add the color blending feature in future, however it is not yet scheduled and I cannot give you a time frame when it will be implemented.

If you still want to do this with code, you can extract images from your theme by using the following code:
Theme theme = ThemeRepository.FindTheme("ControlDefault");
foreach (StyleRepository repository in theme.Repositories)
{
    if (repository.ItemType == "Image")
    {
        foreach (PropertySetting setting in repository.Settings)
        {
            if (setting.Name == "Image")
            {
                Bitmap bmp = setting.Value as Bitmap;
                // do something with the bitmap    
            }
        }
    }
}

I hope this helps.
 
Greetings,
Jack
the Telerik team
Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
0
Miguel
Top achievements
Rank 1
answered on 22 Nov 2012, 05:10 PM
Hi Jack,

Thanks for your reply, that does help. Of course, it would be better if the designer could export the image directly in VSB, maybe it would make an interesting feature?

It would be helpful if the designer could easily relate the exported images to the repository items and properties that use them. Could you point me in the right direction as to how I would obtain this information? Ideally, I would save the bitmap with a name like repositoryitem.property.bmp

Thanks,
Miguel
0
Jack
Telerik team
answered on 26 Nov 2012, 04:47 PM
Hello Miguel,

Yes, this is an interesting feature and I added it in our issue tracking system. We will consider implementing it in a future version. Use the following link to track its status. I updated also your Telerik points.

I am not sure about your second question. This code executes at run time and you cannot use it at design time. You can use the repository Key property to obtain the repository name.
 
Greetings,
Jack
the Telerik team
Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
0
Miguel
Top achievements
Rank 1
answered on 26 Nov 2012, 07:40 PM
Hello Jack.

Sorry, english is not my first language.

What I meant to ask was if there was a way to get the repository item name that contains the image, so that I can save the image with that name (given that I will be exporting all the images from a theme, this will make identifying the image easier for the graphic designer).

I've since found out how to get the repository item name so everything's fine now.

Thanks again for your help,
Miguel
0
Jack
Telerik team
answered on 29 Nov 2012, 03:03 PM
Hello Miguel,

The StyleRepository.Key property represents the repository name. There is also Name property, however it is used only in Visual Style Builder to represent a more friendly name for the repository. That is why I recommend using the Key property in your application.

All the best,
Jack
the Telerik team
Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
Tags
Themes and Visual Style Builder
Asked by
Miguel
Top achievements
Rank 1
Answers by
Jack
Telerik team
Miguel
Top achievements
Rank 1
Share this question
or