Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
RichardA
Sep 1, 2006
.
Dinosaur Gum
To get the property from the name the following works.
code:
public static object GetValue(object src, string propName) {
    return src.GetType().GetProperty(propName).GetValue(src, null);
}
Edit: In most cases. If it is ambiguous you may need to use a different overload of GetProperty. Unless you are using indexers or and a derived class is hiding a property with new you should be fine.

RichardA fucked around with this message at 23:32 on Mar 6, 2014

Adbot
ADBOT LOVES YOU

RichardA
Sep 1, 2006
.
Dinosaur Gum

bobua posted:

Hoping someone here has some knowledge of opencv\emgu. I have a decent understanding of the opencv image structure cv::mat, but I'm trying to rewrite something in c#(emgu) which generally uses an Image<> type instead.

Here's the documentation on the Image<>
http://www.emgu.com/wiki/files/2.4.2/document/html/a8929aab-99c5-79cf-385c-dcec7769fea1.htm

Looking at the docs the method GetSubRect does what you want.

  • Locked thread