Message 1 of 5

Not applicable
08-02-2015
04:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm creating a WPF app for Revit and have some confusion about converting integers to colors. The code below works but I had to change the blue and red channels when creating the System.Windows.Media.Color for my window or the color was wrong.
System.Drawing.Color c = System.Drawing.Color.FromArgb(tnt.get_Parameter(BuiltInParameter.LINE_COLOR).AsInteger()); GraphicColour = System.Windows.Media.Color.FromRgb(c.B, c.G, c.R); //B and R need to be reversed
I saw Jeremy Tammik's post on "The Bullding Coder" blog and tried to use his IntToColor function but had the same result, the channels had to be flipped.
Does anyone know why this is?
Solved! Go to Solution.