看板 C_Sharp 關於我們 聯絡資訊
: : FileStream fs = new FileStream(file_name, FileMode.Open, FileAccess.Read); fs.Seek(72, SeekOrigin.Begin); depths = deCode16L2(fs.ReadByte(), fs.ReadByte()); fs.Seek(42, SeekOrigin.Begin); cols = deCode16L2(fs.ReadByte(), fs.ReadByte()); rows = deCode16L2(fs.ReadByte(), fs.ReadByte()); slices = deCode16L2(fs.ReadByte(), fs.ReadByte()); : : public int deCode16L2(int a, int b) { int result = new int(); if (a != 0) { a += 255; } result = a + b; return result; } 這是要讀取HDR圖檔的程式片斷 請問一下,SEEK這個METHOD是在做什麼?72,42這些數字是可以隨便設的嗎? 為什麼cols,rows,depths,slices是這樣得到@@ decode16l2我也不太了解,請各位多多指教 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 163.25.118.159
aimshield:數字不可以隨便設哦 那個檔案有一定格式 12/04 20:49