예제 #1
0
 public void png_set_pHYs(uint res_x, uint res_y, PNG_RESOLUTION unit_type)
 {
     info_ptr_x_pixels_per_unit = res_x;
     info_ptr_y_pixels_per_unit = res_y;
     info_ptr_phys_unit_type    = unit_type;
     info_ptr_valid            |= PNG_INFO.pHYs;
 }
예제 #2
0
 public PNG_INFO png_get_pHYs(ref uint res_x, ref uint res_y, ref PNG_RESOLUTION unit_type)
 {
     if ((info_ptr_valid & PNG_INFO.pHYs) != PNG_INFO.pHYs)
     {
         return(PNG_INFO.None);
     }
     res_x     = info_ptr_x_pixels_per_unit;
     res_y     = info_ptr_y_pixels_per_unit;
     unit_type = info_ptr_phys_unit_type;
     return(PNG_INFO.pHYs);
 }
예제 #3
0
		public PNG_INFO png_get_pHYs(ref uint res_x, ref uint res_y, ref PNG_RESOLUTION unit_type)
		{
			if((info_ptr_valid&PNG_INFO.pHYs)!=PNG_INFO.pHYs) return PNG_INFO.None;
			res_x=info_ptr_x_pixels_per_unit;
			res_y=info_ptr_y_pixels_per_unit;
			unit_type=info_ptr_phys_unit_type;
			return PNG_INFO.pHYs;
		}
예제 #4
0
		public void png_set_pHYs(uint res_x, uint res_y, PNG_RESOLUTION unit_type)
		{
			info_ptr_x_pixels_per_unit=res_x;
			info_ptr_y_pixels_per_unit=res_y;
			info_ptr_phys_unit_type=unit_type;
			info_ptr_valid|=PNG_INFO.pHYs;
		}
예제 #5
0
		// write the pHYs chunk
		void png_write_pHYs(uint x_pixels_per_unit, uint y_pixels_per_unit, PNG_RESOLUTION unit_type)
		{
			byte[] buf=new byte[9];

			if(unit_type>=PNG_RESOLUTION.LAST) Debug.WriteLine("Unrecognized unit type for pHYs chunk");

			png_save_uint_32(buf, x_pixels_per_unit);
			png_save_uint_32(buf, 4, y_pixels_per_unit);
			buf[8]=(byte)unit_type;

			png_write_chunk(PNG.pHYs, buf, 9);
		}