Condividi tramite


BitmapSourceExtensions.CopyTo Method (BitmapSource, Texture2D, Int32, Nullable<Rectangle>, Int32, Int32)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Copies a sub-region of bitmap to a sub-region of the texture.

Namespace:  System.Windows.Media.Imaging
Assembly:  System.Windows.Xna (in System.Windows.Xna.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Sub CopyTo ( _
    bitmap As BitmapSource, _
    dest As Texture2D, _
    level As Integer, _
    srcRect As Nullable(Of Rectangle), _
    destX As Integer, _
    destY As Integer _
)
public static void CopyTo(
    this BitmapSource bitmap,
    Texture2D dest,
    int level,
    Nullable<Rectangle> srcRect,
    int destX,
    int destY
)

Parameters

  • destX
    Type: System.Int32
    The x-coordinate of the position of the texture to copy the sub-region of the bitmap to.
  • destY
    Type: System.Int32
    The y-coordinate of the position of the texture to copy the sub-region of the bitmap to.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type BitmapSource. When you use instance method syntax to call this method, omit the first parameter.

Remarks

The area of the bitmap image defined by srcRect is copied to the destination texture at position (destX, destY).

Version Information

Silverlight

Supported in: 5

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.