当前位置: 首页>>代码示例>>C#>>正文


C# Media.Clone方法代码示例

本文整理汇总了C#中Media.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# Media.Clone方法的具体用法?C# Media.Clone怎么用?C# Media.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Media的用法示例。


在下文中一共展示了Media.Clone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FindOrAdd

        /// <summary>
        /// Check in the database if a media similar to "newM"
        /// already exists. If the answer is "yes", then the Media
        /// from the database is returned. If the answer is "no", then
        /// the provided Media is added into the database and returned
        /// to the caller.
        /// </summary>
        /// <param name="newM"></param>
        /// <returns></returns>
        private Media FindOrAdd(Media newM)
        {
            foreach (Media m in medias)
            {
                if (m.IsSimilarTo(newM) == true)
                {
                    return m;
                }
            }

            newM = (Media)newM.Clone();
            medias.Add(newM);
            if (MediaAdded != null)
            {
                MediaAdded(newM, EventArgs.Empty);
            }
            return newM;
        }
开发者ID:nnovic,项目名称:GetFacts,代码行数:27,代码来源:Database.cs

示例2: BlitFromMemory

		public override void BlitFromMemory( Media.PixelBox src, Media.BasicBox dstBox )
		{
			if ( this.Buffer.Contains( dstBox ) == false )
			{
				throw new ArgumentOutOfRangeException( "dstBox", "Destination box out of range" );
			}

			PixelBox scaled;

			if ( src.Width != dstBox.Width || src.Height != dstBox.Height || src.Depth != dstBox.Depth )
			{
				//Scale to destination size
				//This also does pixel format conversion if needed
				this.AllocateBuffer();
				scaled = this.Buffer.GetSubVolume( dstBox );
				Image.Scale( src, scaled, ImageFilter.Bilinear );
			}
			else if ( ( src.Format != format ) || ( ( GLES2PixelUtil.GetGLOriginFormat( src.Format ) == 0 ) && ( src.Format != PixelFormat.R8G8B8 ) ) )
			{
				//Extents match, but format is not accepted as valid source format for GL
				//do conversion in temporary buffer
				this.AllocateBuffer();
				scaled = this.Buffer.GetSubVolume( dstBox );
				PixelConverter.BulkPixelConversion( src, scaled );
				if ( src.Format == PixelFormat.A4R4G4B4 )
				{
					// ARGB->BGRA
					GLES2PixelUtil.ConvertToGLFormat( ref scaled, ref scaled );
				}
			}
			else
			{
				this.AllocateBuffer();
				scaled = src.Clone();

				if ( src.Format == PixelFormat.R8G8B8 )
				{
					scaled.Format = PixelFormat.B8G8R8;
					PixelConverter.BulkPixelConversion( src, scaled );
				}
			}

			this.Upload( scaled, dstBox );
			this.FreeBuffer();
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:45,代码来源:GLES2HardwarePixelBuffer.cs

示例3: ShowRtpPacket

 void ShowRtpPacket(object sender, Media.Rtp.RtpPacket packet)
 {
     try
     {
         if (this.InvokeRequired) Invoke(new FillGridRtp(AddRtp), packet.Clone(true, true, true, true, true));
         else RTPPacketBinding.Add((IPacket)packet.Clone(true, true, true, true, true));
     }
     catch { }
 }
开发者ID:qinpengit,项目名称:net7mma-111212,代码行数:9,代码来源:RtspInspector.cs


注:本文中的Media.Clone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。