Ejemplo n.º 1
0
        /// <summary>
        /// Creates a TIME chunk,  <c>nsecs</c> in the past from now.
        /// </summary>
        /// <param name="nsecs">Seconds in the past. If negative, it's a future time</param>
        /// <returns>The created and queued chunk</returns>
        public PngChunkTIME SetTimeNow(int nsecs)
        {
            PngChunkTIME c = new PngChunkTIME(chunkList.imageInfo);

            c.SetNow(nsecs);
            QueueChunk(c);
            return(c);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a TIME chunk with given date and time
        /// </summary>
        /// <param name="year">Year</param>
        /// <param name="mon">Month (1-12)</param>
        /// <param name="day">Day of month (1-31)</param>
        /// <param name="hour">Hour (0-23)</param>
        /// <param name="min">Minute (0-59)</param>
        /// <param name="sec">Seconds (0-59)</param>
        /// <returns>The created and queued chunk</returns>
        public PngChunkTIME SetTimeYMDHMS(int year, int mon, int day, int hour, int min, int sec)
        {
            PngChunkTIME c = new PngChunkTIME(chunkList.imageInfo);

            c.SetYMDHMS(year, mon, day, hour, min, sec);
            QueueChunk(c, true);
            return(c);
        }
Ejemplo n.º 3
0
        public override void CloneDataFromRead(PngChunk other)
        {
            PngChunkTIME x = (PngChunkTIME)other;

            year = x.year;
            mon  = x.mon;
            day  = x.day;
            hour = x.hour;
            min  = x.min;
            sec  = x.sec;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Gets image timestamp, TIME chunk, as a string
        /// </summary>
        /// <returns>Formated TIME, empty string if not present</returns>
        public string GetTimeAsString()
        {
            PngChunkTIME c = GetTime();

            return(c != null?c.GetAsString() : "");
        }