public void png_set_sCAL(PNG_SCALE unit, double width, double height) { info_ptr_scal_unit = unit; info_ptr_scal_pixel_width = width; info_ptr_scal_pixel_height = height; info_ptr_valid |= PNG_INFO.sCAL; }
public PNG_INFO png_get_sCAL(ref PNG_SCALE unit, ref double width, ref double height) { if ((info_ptr_valid & PNG_INFO.sCAL) != PNG_INFO.sCAL) { return(PNG_INFO.None); } unit = info_ptr_scal_unit; width = info_ptr_scal_pixel_width; height = info_ptr_scal_pixel_height; return(PNG_INFO.sCAL); }
public PNG_INFO png_get_sCAL(ref PNG_SCALE unit, ref double width, ref double height) { if((info_ptr_valid&PNG_INFO.sCAL)!=PNG_INFO.sCAL) return PNG_INFO.None; unit=info_ptr_scal_unit; width=info_ptr_scal_pixel_width; height=info_ptr_scal_pixel_height; return PNG_INFO.sCAL; }
public void png_set_sCAL(PNG_SCALE unit, double width, double height) { info_ptr_scal_unit=unit; info_ptr_scal_pixel_width=width; info_ptr_scal_pixel_height=height; info_ptr_valid|=PNG_INFO.sCAL; }
// write the sCAL chunk void png_write_sCAL(PNG_SCALE unit, double width, double height) { byte[] strWidth=Encoding.ASCII.GetBytes(width.ToString("G12", nc)); byte[] strHeight=Encoding.ASCII.GetBytes(height.ToString("G12", nc)); byte[] buf=new byte[strWidth.Length+strHeight.Length+2]; buf[0]=(byte)unit; Array.Copy(strWidth, 0, buf, 1, strWidth.Length); buf[strWidth.Length+1]=0; Array.Copy(strHeight, 0, buf, strWidth.Length+2, strHeight.Length); png_write_chunk(PNG.sCAL, buf, (uint)buf.Length); }