GetAttributeInt() public méthode

See for general information. This method finds the value as string in dicionary and then tries to parse it as int. Returns "null" if key was not found or there was an error while parsing.
public GetAttributeInt ( String name ) : Int32?
name String
Résultat Int32?
Exemple #1
0
        /// <summary>
        /// Gets width and height of video from video StreamInfo, then applies <see cref="UtilsCommon.GetMaxScaling">.
        /// </summary>
        public static double GetMaxScalingByStreamInfo(StreamInfo videoStreamInfo, double maxWidth, double maxHeight, Settings.RescaleModeEnum rescaleMode)
        {
            if (rescaleMode == Settings.RescaleModeEnum.NoRescaling)
            {
                return(1);
            }

            // get size of image in video streams
            Int32?videoWidth  = videoStreamInfo.GetAttributeInt("width");
            Int32?videoHeight = videoStreamInfo.GetAttributeInt("height");

            if (videoWidth == null)
            {
                videoWidth = -1;                                        // ignore this dimension
            }
            if (videoHeight == null)
            {
                videoHeight = -1;                                         // ignore this dimension
            }
            return(UtilsCommon.GetMaxScaling(videoWidth.Value, videoHeight.Value, maxWidth, maxHeight, rescaleMode == Settings.RescaleModeEnum.Downscale));
        }