/// <summary> /// Parse data into human-readable format, if possible /// </summary> private void ParseData() { switch (Type.ToString()) { case "IHDR": ParsedData = new ParsedIHDR(data); break; case "gAMA": ParsedData = new ParsedGAMA(data); break; case "tEXt": ParsedData = new ParsedTEXT(data); break; case "iTXt": ParsedData = new ParsedITXT(data); break; case "tIME": ParsedData = new ParsedTIME(data); break; default: break; } }
public static PngDataChunk NewItxtChunk(string keyword, bool compressed, string language, string translatedKeyword, string text) { ParsedITXT data = new ParsedITXT(keyword, compressed, language, translatedKeyword, text); PngDataChunk chunk = new PngDataChunk(new ChunkType("iTXt")); chunk.ParsedData = data; chunk.UpdateData(); chunk.UpdateLength(); chunk.UpdateLength(); return(chunk); }