의 자녀 인 클래스가 System.Drawing.Bitmap
있습니다. 생성자를 호출하려고하는데 기본 클래스 생성자를 호출하는 동안 문제가 있습니다.
보다 구체적으로 특정 생성자를 호출하고 싶습니다.
Bitmap(String)
: 지정된 파일에서 Bitmap 클래스의 새 인스턴스를 초기화합니다.
문제는 오류가 Object 클래스를 참조하기Bitmap
때문에 내 클래스가 클래스에서 상속된다는 것을 인식하지 못한다는 것입니다 .
어쨌든 내 수업은 다음과 같습니다.
class MyBitmap : Bitmap
{
private String photographer, description, title;
public String Photographer
{
get
{
return this.photographer;
}
}
public String Description
{
get
{
return this.description;
}
}
public String Title
{
get
{
return this.title;
}
}
public MyBitmap(String filePath, String title, String description, String photographer) : base(filePath)
{
this.title = title;
this.description = description;
this.photographer = photographer;
}
}
오류의 이유 System.Drawing.Bitmap
는 봉인 된 클래스 때문입니다.
그래서 당신은 전혀 물려받을 수 없습니다Bitmap
. 컴파일러 오류 메시지를 확인하십시오 CS0509
. 오류가 발생했을 것 입니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다