0
데이터를 저장하기 위해 직렬화하는 두 개의 클래스가 있습니다.xml 역 직렬화 중에 연산을 수행하는 방법
[Serializable]
public class Album
{
private string nom;
[XmlElement]
public string Nom
{
get { return nom; }
set { nom = value; }
}
private List<Photo> photos = new List<Photo>();
[XmlArray]
public List<Photo> Photos
{
get { return photos; }
set { photos = value; }
}
...
}
그리고 일부 사진 : 당신이 볼 수 있듯이
[Serializable]
public class Photo
{
private string nom;
[XmlElement]
public string Nom
{
get { return nom; }
set { nom = value; }
}
private string path;
[XmlElement]
public string Path
{
get { return path; }
set { path = value; }
}
private Image image;
[XmlIgnore]
public Image Image
{
get { return image; }
set { image = value; }
}
...
}
, 나는 비트 맵 이미지를 직렬화하고 있지 않다. 그러나 XML을 deserialize 할 때 Bitmap 객체가 동시에 생성되기를 바랍니다.
솔루션은 비 직렬화 후에 루프를 사용하여 비트 맵 이미지를 만드는 것이지만 적절한 방법이 있다고 생각합니다.
도와 주시겠습니까?
내가 찾고 있던 바로 그거야! – thibon
환영합니다 !! –