Grasshopper

algorithmic modeling for Rhino

I understand that the image sampler will most likely be as complex if not more complex than the path mapper was (when I tried to crack that nut), however, I would like to create points in VB, then have those points check their color and/or brightness of an image either placed in rhino or put into the code.

 

Any suggestions?

Views: 963

Replies to This Discussion

Hi Andy,

 

the ImageSampler uses a public Grasshopper class for fast and interpolated sampling. Have a look at Grasshopper.Kernel.GH_MemoryBitmap.

 

One important thing, you must always call the Release() method when you are done sampling, otherwise the bitmap will remain locked in memory and it won't be possible to access it again.

 

If you don't care about high performance, you can always use the GetPixel() method on any System.Drawing.Bitmap to get the colour of a pixel.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thank you once again David. It worked fine but it doesn't seem as capable as the image sampler. I didn't end up needing it anyway but I always like to learn new parts of the SDK

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service