BitmapFrame.Create Yöntem

Tanım

Sağlanan bağımsız değişkenleri temel alan yeni BitmapFrame bir oluşturur.

Aşırı Yüklemeler

Name Description
Create(Stream)

Belirli BitmapFramebir sürümünden yeni Stream bir oluşturur.

Create(Uri)

Belirli BitmapFramebir sürümünden yeni Uri bir oluşturur.

Create(BitmapSource)

Belirli BitmapFramebir sürümünden yeni BitmapSource bir oluşturur.

Create(Uri, RequestCachePolicy)

Belirtilen BitmapFrameile verilenden Uri bir RequestCachePolicy oluşturur.

Create(BitmapSource, BitmapSource)

Belirtilen küçük resimle verilenden BitmapFrame yeni BitmapSource bir oluşturur.

Create(Stream, BitmapCreateOptions, BitmapCacheOption)

belirtilen BitmapFrame ve Streamile verilenden BitmapCreateOptions yeni BitmapCacheOption bir oluşturur.

Create(Uri, BitmapCreateOptions, BitmapCacheOption)

belirtilen BitmapFrame ve Uriile verilen'den BitmapCreateOptions bir BitmapCacheOption oluşturur.

Create(Uri, BitmapCreateOptions, BitmapCacheOption, RequestCachePolicy)

Belirtilen BitmapFrame, Urive BitmapCreateOptionsile verilenden BitmapCacheOption bir RequestCachePolicy oluşturur.

Create(BitmapSource, BitmapSource, BitmapMetadata, ReadOnlyCollection<ColorContext>)

Belirtilen küçük resim BitmapFrame, ve BitmapSourceile verilenden BitmapMetadata yeni ColorContext bir oluşturur.

Create(Stream)

Belirli BitmapFramebir sürümünden yeni Stream bir oluşturur.

public:
 static System::Windows::Media::Imaging::BitmapFrame ^ Create(System::IO::Stream ^ bitmapStream);
public static System.Windows.Media.Imaging.BitmapFrame Create(System.IO.Stream bitmapStream);
static member Create : System.IO.Stream -> System.Windows.Media.Imaging.BitmapFrame
Public Shared Function Create (bitmapStream As Stream) As BitmapFrame

Parametreler

bitmapStream
Stream

Stream oluşturmak BitmapFrameiçin kullanılan .

Döndürülenler

BitmapFrame Belirli bir öğesinin A'sıStream.

Açıklamalar

bitmapStream, çerçeve oluşturulduktan sonra yalnızca OnLoad önbellek seçeneği kullanıldığında kapatılabilir. Varsayılan OnDemand önbellek seçeneği, çerçeve gerekli olana kadar akışı korur. Create(Stream, BitmapCreateOptions, BitmapCacheOption) Oluşturma ve önbellek seçeneklerini belirtmek için yöntemini kullanın.

Şunlara uygulanır

Create(Uri)

Belirli BitmapFramebir sürümünden yeni Uri bir oluşturur.

public:
 static System::Windows::Media::Imaging::BitmapFrame ^ Create(Uri ^ bitmapUri);
public static System.Windows.Media.Imaging.BitmapFrame Create(Uri bitmapUri);
static member Create : Uri -> System.Windows.Media.Imaging.BitmapFrame
Public Shared Function Create (bitmapUri As Uri) As BitmapFrame

Parametreler

bitmapUri
Uri

kaynağını UriBitmapFrametanımlayan.

Döndürülenler

BitmapFrame Belirli bir öğesinin A'sıUri.

Örnekler

Aşağıdaki kod örneği, belirli BitmapFramebir 'den nasıl oluşturacaklarını Uri gösterir.

int width = 128;
int height = width;
int stride = width/8;
byte[] pixels = new byte[height*stride];

// Try creating a new image with a custom palette.
List<System.Windows.Media.Color> colors = new List<System.Windows.Media.Color>();
colors.Add(System.Windows.Media.Colors.Red);
colors.Add(System.Windows.Media.Colors.Blue);
colors.Add(System.Windows.Media.Colors.Green);
BitmapPalette myPalette = new BitmapPalette(colors);

// Creates a new empty image with the pre-defined palette

BitmapSource image = BitmapSource.Create(
    width,
    height,
    96,
    96,
    PixelFormats.Indexed1,
    myPalette, 
    pixels, 
    stride);

FileStream stream = new FileStream("empty.tif", FileMode.Create);
TiffBitmapEncoder encoder = new TiffBitmapEncoder();
TextBlock myTextBlock = new TextBlock();
myTextBlock.Text = "Codec Author is: " + encoder.CodecInfo.Author.ToString();
encoder.Frames.Add(BitmapFrame.Create(image));
MessageBox.Show(myPalette.Colors.Count.ToString());
encoder.Save(stream);
Dim width As Integer = 128
Dim height As Integer = width
Dim stride As Integer = CType(width / 8, Integer)
Dim pixels(height * stride) As Byte

' Try creating a new image with a custom palette.
Dim colors As New List(Of System.Windows.Media.Color)()
colors.Add(System.Windows.Media.Colors.Red)
colors.Add(System.Windows.Media.Colors.Blue)
colors.Add(System.Windows.Media.Colors.Green)
Dim myPalette As New BitmapPalette(colors)

' Creates a new empty image with the pre-defined palette
Dim image As BitmapSource = System.Windows.Media.Imaging.BitmapSource.Create(width, height, 96, 96, PixelFormats.Indexed1, myPalette, pixels, stride)
Dim stream As New FileStream("empty.tif", FileMode.Create)
Dim encoder As New TiffBitmapEncoder()
Dim myTextBlock As New TextBlock()
myTextBlock.Text = "Codec Author is: " + encoder.CodecInfo.Author.ToString()
encoder.Frames.Add(BitmapFrame.Create(image))
MessageBox.Show(myPalette.Colors.Count.ToString())
encoder.Save(stream)

Şunlara uygulanır

Create(BitmapSource)

Belirli BitmapFramebir sürümünden yeni BitmapSource bir oluşturur.

public:
 static System::Windows::Media::Imaging::BitmapFrame ^ Create(System::Windows::Media::Imaging::BitmapSource ^ source);
public static System.Windows.Media.Imaging.BitmapFrame Create(System.Windows.Media.Imaging.BitmapSource source);
static member Create : System.Windows.Media.Imaging.BitmapSource -> System.Windows.Media.Imaging.BitmapFrame
Public Shared Function Create (source As BitmapSource) As BitmapFrame

Parametreler

source
BitmapSource

BitmapSource bunu BitmapFrameoluşturmak için kullanılan .

Döndürülenler

BitmapFrame Belirli bir öğesinin A'sıBitmapSource.

Şunlara uygulanır

Create(Uri, RequestCachePolicy)

Belirtilen BitmapFrameile verilenden Uri bir RequestCachePolicy oluşturur.

public:
 static System::Windows::Media::Imaging::BitmapFrame ^ Create(Uri ^ bitmapUri, System::Net::Cache::RequestCachePolicy ^ uriCachePolicy);
public static System.Windows.Media.Imaging.BitmapFrame Create(Uri bitmapUri, System.Net.Cache.RequestCachePolicy uriCachePolicy);
static member Create : Uri * System.Net.Cache.RequestCachePolicy -> System.Windows.Media.Imaging.BitmapFrame
Public Shared Function Create (bitmapUri As Uri, uriCachePolicy As RequestCachePolicy) As BitmapFrame

Parametreler

bitmapUri
Uri

bit eşleminin BitmapFrame oluşturulduğu konum.

uriCachePolicy
RequestCachePolicy

Bu BitmapFrameiçin önbelleğe alma gereksinimleri.

Döndürülenler

BitmapFrame Belirtilen Uriile verilenden RequestCachePolicy a.

Açıklamalar

Create(Uri, RequestCachePolicy), .NET Framework sürüm 3.5'te kullanıma sunulmuştur. Daha fazla bilgi için bkz . Sürümler ve Bağımlılıklar.

Şunlara uygulanır

Create(BitmapSource, BitmapSource)

Belirtilen küçük resimle verilenden BitmapFrame yeni BitmapSource bir oluşturur.

public:
 static System::Windows::Media::Imaging::BitmapFrame ^ Create(System::Windows::Media::Imaging::BitmapSource ^ source, System::Windows::Media::Imaging::BitmapSource ^ thumbnail);
public static System.Windows.Media.Imaging.BitmapFrame Create(System.Windows.Media.Imaging.BitmapSource source, System.Windows.Media.Imaging.BitmapSource thumbnail);
static member Create : System.Windows.Media.Imaging.BitmapSource * System.Windows.Media.Imaging.BitmapSource -> System.Windows.Media.Imaging.BitmapFrame
Public Shared Function Create (source As BitmapSource, thumbnail As BitmapSource) As BitmapFrame

Parametreler

source
BitmapSource

öğesinin BitmapFrame oluşturulduğu kaynak.

thumbnail
BitmapSource

Elde edilen BitmapFrameöğesinin küçük resim görüntüsü.

Döndürülenler

BitmapFrame Belirtilen küçük resimle verilenden BitmapSource a.

Şunlara uygulanır

Create(Stream, BitmapCreateOptions, BitmapCacheOption)

belirtilen BitmapFrame ve Streamile verilenden BitmapCreateOptions yeni BitmapCacheOption bir oluşturur.

public:
 static System::Windows::Media::Imaging::BitmapFrame ^ Create(System::IO::Stream ^ bitmapStream, System::Windows::Media::Imaging::BitmapCreateOptions createOptions, System::Windows::Media::Imaging::BitmapCacheOption cacheOption);
public static System.Windows.Media.Imaging.BitmapFrame Create(System.IO.Stream bitmapStream, System.Windows.Media.Imaging.BitmapCreateOptions createOptions, System.Windows.Media.Imaging.BitmapCacheOption cacheOption);
static member Create : System.IO.Stream * System.Windows.Media.Imaging.BitmapCreateOptions * System.Windows.Media.Imaging.BitmapCacheOption -> System.Windows.Media.Imaging.BitmapFrame
Public Shared Function Create (bitmapStream As Stream, createOptions As BitmapCreateOptions, cacheOption As BitmapCacheOption) As BitmapFrame

Parametreler

bitmapStream
Stream

Bunun oluşturulduğu akış BitmapFrame .

createOptions
BitmapCreateOptions

Bunu BitmapFrameoluşturmak için kullanılan seçenekler.

cacheOption
BitmapCacheOption

Bunu BitmapFrameoluşturmak için kullanılan önbellek seçeneği.

Döndürülenler

BitmapFrame belirtilen Stream ve BitmapCreateOptionsile verilenden BitmapCacheOption a.

Açıklamalar

OnLoad Bit eşlem oluşturulduktan sonra öğesini kapatmak bitmapStream istiyorsanız önbellek seçeneğini kullanın. Varsayılan OnDemand önbellek seçeneği, bit eşlem gerekli olana ve temizleme çöp toplayıcı tarafından işlenene kadar akışa erişimi korur.

Şunlara uygulanır

Create(Uri, BitmapCreateOptions, BitmapCacheOption)

belirtilen BitmapFrame ve Uriile verilen'den BitmapCreateOptions bir BitmapCacheOption oluşturur.

public:
 static System::Windows::Media::Imaging::BitmapFrame ^ Create(Uri ^ bitmapUri, System::Windows::Media::Imaging::BitmapCreateOptions createOptions, System::Windows::Media::Imaging::BitmapCacheOption cacheOption);
public static System.Windows.Media.Imaging.BitmapFrame Create(Uri bitmapUri, System.Windows.Media.Imaging.BitmapCreateOptions createOptions, System.Windows.Media.Imaging.BitmapCacheOption cacheOption);
static member Create : Uri * System.Windows.Media.Imaging.BitmapCreateOptions * System.Windows.Media.Imaging.BitmapCacheOption -> System.Windows.Media.Imaging.BitmapFrame
Public Shared Function Create (bitmapUri As Uri, createOptions As BitmapCreateOptions, cacheOption As BitmapCacheOption) As BitmapFrame

Parametreler

bitmapUri
Uri

bit eşleminin BitmapFrame oluşturulduğu konum.

createOptions
BitmapCreateOptions

Bunu BitmapFrameoluşturmak için kullanılan seçenekler.

cacheOption
BitmapCacheOption

Bunu BitmapFrameoluşturmak için kullanılan önbellek seçeneği.

Döndürülenler

BitmapFrame Belirtilen Urive BitmapCreateOptionsile verilenden BitmapCacheOption bir.

Şunlara uygulanır

Create(Uri, BitmapCreateOptions, BitmapCacheOption, RequestCachePolicy)

Belirtilen BitmapFrame, Urive BitmapCreateOptionsile verilenden BitmapCacheOption bir RequestCachePolicy oluşturur.

public:
 static System::Windows::Media::Imaging::BitmapFrame ^ Create(Uri ^ bitmapUri, System::Windows::Media::Imaging::BitmapCreateOptions createOptions, System::Windows::Media::Imaging::BitmapCacheOption cacheOption, System::Net::Cache::RequestCachePolicy ^ uriCachePolicy);
public static System.Windows.Media.Imaging.BitmapFrame Create(Uri bitmapUri, System.Windows.Media.Imaging.BitmapCreateOptions createOptions, System.Windows.Media.Imaging.BitmapCacheOption cacheOption, System.Net.Cache.RequestCachePolicy uriCachePolicy);
static member Create : Uri * System.Windows.Media.Imaging.BitmapCreateOptions * System.Windows.Media.Imaging.BitmapCacheOption * System.Net.Cache.RequestCachePolicy -> System.Windows.Media.Imaging.BitmapFrame
Public Shared Function Create (bitmapUri As Uri, createOptions As BitmapCreateOptions, cacheOption As BitmapCacheOption, uriCachePolicy As RequestCachePolicy) As BitmapFrame

Parametreler

bitmapUri
Uri

bit eşleminin BitmapFrame oluşturulduğu konum.

createOptions
BitmapCreateOptions

Bunu BitmapFrameoluşturmak için kullanılan seçenekler.

cacheOption
BitmapCacheOption

Bunu BitmapFrameoluşturmak için kullanılan önbellek seçeneği.

uriCachePolicy
RequestCachePolicy

Bu BitmapFrameiçin önbelleğe alma gereksinimleri.

Döndürülenler

BitmapFrame Belirtilen Uri, BitmapCreateOptionsve BitmapCacheOptionile verilenden RequestCachePolicy bir

Açıklamalar

Create(Uri, BitmapCreateOptions, BitmapCacheOption, RequestCachePolicy), .NET Framework sürüm 3.5'te kullanıma sunulmuştur. Daha fazla bilgi için bkz . Sürümler ve Bağımlılıklar.

Şunlara uygulanır

Create(BitmapSource, BitmapSource, BitmapMetadata, ReadOnlyCollection<ColorContext>)

Belirtilen küçük resim BitmapFrame, ve BitmapSourceile verilenden BitmapMetadata yeni ColorContext bir oluşturur.

public:
 static System::Windows::Media::Imaging::BitmapFrame ^ Create(System::Windows::Media::Imaging::BitmapSource ^ source, System::Windows::Media::Imaging::BitmapSource ^ thumbnail, System::Windows::Media::Imaging::BitmapMetadata ^ metadata, System::Collections::ObjectModel::ReadOnlyCollection<System::Windows::Media::ColorContext ^> ^ colorContexts);
public static System.Windows.Media.Imaging.BitmapFrame Create(System.Windows.Media.Imaging.BitmapSource source, System.Windows.Media.Imaging.BitmapSource thumbnail, System.Windows.Media.Imaging.BitmapMetadata metadata, System.Collections.ObjectModel.ReadOnlyCollection<System.Windows.Media.ColorContext> colorContexts);
static member Create : System.Windows.Media.Imaging.BitmapSource * System.Windows.Media.Imaging.BitmapSource * System.Windows.Media.Imaging.BitmapMetadata * System.Collections.ObjectModel.ReadOnlyCollection<System.Windows.Media.ColorContext> -> System.Windows.Media.Imaging.BitmapFrame
Public Shared Function Create (source As BitmapSource, thumbnail As BitmapSource, metadata As BitmapMetadata, colorContexts As ReadOnlyCollection(Of ColorContext)) As BitmapFrame

Parametreler

source
BitmapSource

BitmapSource bunu BitmapFrameoluşturmak için kullanılan .

thumbnail
BitmapSource

Elde edilen BitmapFrameöğesinin küçük resim görüntüsü.

metadata
BitmapMetadata

Bu BitmapFrameile ilişkilendirilecek meta veriler.

colorContexts
ReadOnlyCollection<ColorContext>

Bu ColorContextBitmapFrameile ilişkili nesneler.

Döndürülenler

BitmapFrame Belirtilen küçük resim BitmapSource, ve BitmapMetadataile verilenden ColorContext bir.

Şunlara uygulanır