使用c#进行数字图像裂缝检测和消除 [英] Digital Image Crack Detection and Removing by using c#

查看:89
本文介绍了使用c#进行数字图像裂缝检测和消除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Ubaidur rahman,有人可以帮助我使用c#从事数字图像裂缝检测和消除工作,但是我有该项目的vb.net源代码.

我的问题是我不知道如何为具有相同类名的类创建数组.
例如在vb.net中,有一个窗口窗体,其名称为"frmImage"

Hi I am Ubaidur rahman, Can any one help me I am working in Digital Image Crack Detection and Removing by using c# but I have vb.net source code for that project.

My problem is I don''t know how to create array for a class with same class name.
For example in vb.net there is a one window form it''s name "frmImage"

Dim frmImages As  frmImage()

int nImage=0
frmImages(nImages)=New frmImage()


我的问题是如何在C#中为具有相同类名的类创建数组?

谢谢
拉曼
[DELETED] @ gmail.com

[edit]除非您真的喜欢垃圾邮件,否则请不要在任何论坛中发布您的电子邮件地址!如果有人回复您,您将收到一封电子邮件,通知您-OriginalGriff [/edit]


My question is how to create array for a class with same class name in C#?

thanks
rahman
[DELETED]@gmail.com

[edit]Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email to let you know - OriginalGriff[/edit]

推荐答案

尝试:
frmImage[] images = new frmImage[numberOfImagesRequired];

请记住,这只会创建数组,而不会创建表单本身.就像在VB中一样,您将需要在循环中添加单个frmImage实例.

或者更好地,设置一个图像列表,这样您就不必事先知道会有多少张图像了:

Bear in mind that this only creates the array, it does not create the forms themselves. Just as in VB, you will need to add individual frmImage instances in a loop for example.

Or better, set up a list of images, that way you don''t need to know how many there will be in advance:

List<frmImage> images = new List<frmImage>()
images.Add(new frmImage());

如果以后确实需要它,可以从列表中获取一个数组:

You can get an array from the list if you really need it later:

frmImage[] arrayOfFrmImages = images.ToArray();



"感谢
有没有办法用C#或等效于VB ReDim的ReDim
例如:Dim Pixels(,)Integer
.
(一些逻辑)
.
ReDim像素(行,列)
谁能帮我 ? plz
在此先感谢"


否.C#中没有Redim.
您必须手动声明它,方法是声明一个适当大小的新数组,然后将元素复制过来.
MSDN:Array.Copy [



"thanks
is there a way to ReDim in C# or any Equivalent to VB ReDim
ex: Dim Pixels(,) As Integer
.
.(some logic)
.
ReDim Pixels(Rows, Cols)
can any one help me ? plz
thanks in advance"


No. There is no Redim in C#.
You have to do it manually, by declaring a new array of the appropriate size and copying your elements over.
MSDN: Array.Copy[^]


这篇关于使用c#进行数字图像裂缝检测和消除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆