Grasshopper

algorithmic modeling for Rhino

Hello,

I've been trying to retrieve the background color being used within a Rhino file. After digging around it seemed that "FrameBackgroundColor" was the appropriate method but I've had difficulty implementing it. In particular I am receiving 'FrameBackgroundColor' does not exist in the namespace 'Rhino.ApplicationSettings' warnings.

Would someone be kind enough to point me in the right direction?

A snip of code would be awesome - abstract descriptions can be hard to understand.

Views: 289

Replies to This Discussion

All: here is the base solution to set or get the color (it was in an existing thread).

http://www.grasshopper3d.com/forum/topics/how-to-change-the-backgro...

GH Development Team:

Just a side note - it seems that the method 'System.Drawing.Color.FromArgb(A#, R#, G#, B#)', is not fully implemented when applied to custom view. For example:

args.Display.Draw2dText("text", System.Drawing.Color.FromArgb(80, 100, 100, 100), Point, false, 17, "Arial");

GH accepts the method but does not actually implement the alpha channel, at least for text rendering. I have not tested this more extensively.

Rhino display often doesn't support alpha values. The Color structure is provided by .NET and we didn't want to use a different colour type just for those cases where alpha channels aren't allowed, so instead we ignore them.

In answer to your background question, it's quite complicated, Rhino supports flat backgrounds, but also gradient backgrounds. Then it depends on what drawing mode a viewport is in, especially in Rendered mode things get very complex.

David,

Thank you, this makes sense.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service