Saturday, October 6, 2012

Changing color of an image - at runtime

Changing color of an image - at runtime

Im going to make a new application for a car dealership. They basically want a WPF/silverlight application where one can slect a car (model) and then via a color palette choose the color of the car (from predefined colors). They also need to be able to different kind of rims, headlights and interior.

what is the best/easiest approach for this. Been thinking on having all the different images and then just swap them out when the selection changes. This, however has the potentional problem of all images with all combinations does not exist (eg. a red VW, metallic rims, white leather interior) etc.

Is there any other approach to this? replacing colors? Having a basic model and then copying the "body" of the car on top, copy rims on top etc. and then just having to enable/disable a particular "layer" of the images?

Answers & Comments...

Answer: 1

I would do this by using different layers: the basic model with the car's color as translucent part, on top of this pictures with the different add-ons, the background color is the car's color. The trick is to fit everything together that it looks good.

Depending on the color (maybe you want to have shadows or chrome effects), you could have one model's picture for each color, and then add the add-ons and the interior on top of this.

by : OliKhttp://stackoverflow.com/users/23578




No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog