1

I know how to use this function according to the example,i'm just wondering is there any ways to explain this.

    [SerializableAttribute]
public class Image<TColor, TDepth> : CvArray<TDepth>, 
    IImage, IDisposable, ICloneable, IEquatable<Image<TColor, TDepth>>
where TColor : new(), ColorType


 Image<Bgr, Byte> img = 
           new Image<Bgr, byte>(fileNameTextBox.Text)
           .Resize(400, 400, Emgu.CV.CvEnum.Inter.Linear, true);

i cannot offer more information about this,Thank you!

BeNice
  • 87
  • 6
  • Read about [c# generics](https://msdn.microsoft.com/en-us/library/512aeb7t.aspx) – René Vogt Feb 06 '17 at 06:44
  • And then the [`Image` documentation](http://www.emgu.com/wiki/files/3.1.0-r16.12/document/html/a8929aab-99c5-79cf-385c-dcec7769fea1.htm) which describes these type parameters. – Jon Skeet Feb 06 '17 at 06:46
  • Sorry, used an outdated link, updated my comment with this: https://msdn.microsoft.com/en-us/library/512aeb7t.aspx – René Vogt Feb 06 '17 at 06:47
  • @René Vogt thank you ,i know the generics class ,Does that mean is a new type .sorry to ask you again.. – BeNice Feb 06 '17 at 06:59
  • It means that `Bgr` and `Byte` are the generic arguments for the generic type `Image`. `TColor` will be `Bgr` and `TDepth` will be `Byte`. The resulting type is `Image`. If you know generics, I don't understand the question. – René Vogt Feb 06 '17 at 07:04

1 Answers1

0

Looks like a more basics related qustion. You can use multiple generic types when defining a class. So List<T> used one, Image<T1,T2> uses two and Tuple<T1,T2,...,T7,Trest> uses up to eight in different steps (you can take a Tuple<T1,T2,T3> with just three generic items too). There is a lot of stuff to know about generics - this one for example.

But actually this question is not really EmguCV related..

Ryugeist
  • 103
  • 9