Aracılığıyla paylaş


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

Create(Stream)

Belirli Streambir sürümünden yeni BitmapFrame bir oluşturur.

Create(Uri)

Belirli Uribir sürümünden yeni BitmapFrame bir oluşturur.

Create(BitmapSource)

Belirli BitmapSourcebir sürümünden yeni BitmapFrame bir oluşturur.

Create(Uri, RequestCachePolicy)

Belirtilen RequestCachePolicyile verilenden Uri bir BitmapFrame oluşturur.

Create(BitmapSource, BitmapSource)

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

Create(Stream, BitmapCreateOptions, BitmapCacheOption)

belirtilen BitmapCreateOptions ve BitmapCacheOptionile verilenden Stream yeni BitmapFrame bir oluşturur.

Create(Uri, BitmapCreateOptions, BitmapCacheOption)

belirtilen BitmapCreateOptions ve BitmapCacheOptionile verilenden Uri bir BitmapFrame oluşturur.

Create(Uri, BitmapCreateOptions, BitmapCacheOption, RequestCachePolicy)

BitmapFrame Belirtilen BitmapCreateOptions, BitmapCacheOptionve RequestCachePolicyile verilen Uri bir öğesini oluşturur.

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

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

Create(Stream)

Belirli Streambir sürümünden yeni BitmapFrame 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

oluşturmak StreamBitmapFrameiçin kullanılan .

Döndürülenler

BitmapFrame Belirli Streambir ...

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 önbelleğe alma seçeneklerini belirtmek için yöntemini kullanın.

Şunlara uygulanır

Create(Uri)

Belirli Uribir sürümünden yeni BitmapFrame 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 Uribir ...

Örnekler

Aşağıdaki kod örneği, belirli Uribir 'den nasıl oluşturacaklarını BitmapFrame 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 BitmapSourcebir sürümünden yeni BitmapFrame 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 BitmapSourcebir ...

Şunlara uygulanır

Create(Uri, RequestCachePolicy)

Belirtilen RequestCachePolicyile verilenden Uri bir BitmapFrame 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 RequestCachePolicyile verilen Uri bir içinden gelen .

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 BitmapSource yeni BitmapFrame 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 BitmapFrameedilen öğesinin küçük resmi.

Döndürülenler

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

Şunlara uygulanır

Create(Stream, BitmapCreateOptions, BitmapCacheOption)

belirtilen BitmapCreateOptions ve BitmapCacheOptionile verilenden Stream yeni BitmapFrame 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

Bu BitmapFrameöğesini oluşturmak için kullanılan önbellek seçeneği.

Döndürülenler

BitmapFrame belirtilen BitmapCreateOptions ve BitmapCacheOptionile verilen Stream bir kaynaktan.

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 BitmapCreateOptions ve BitmapCacheOptionile verilenden Uri bir BitmapFrame 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

Bu BitmapFrameöğesini oluşturmak için kullanılan önbellek seçeneği.

Döndürülenler

BitmapFrame Belirtilen BitmapCreateOptionsve BitmapCacheOptionile verilen Uri bir kaynaktan.

Şunlara uygulanır

Create(Uri, BitmapCreateOptions, BitmapCacheOption, RequestCachePolicy)

BitmapFrame Belirtilen BitmapCreateOptions, BitmapCacheOptionve RequestCachePolicyile verilen Uri bir öğesini 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

Bu BitmapFrameöğesini oluşturmak için kullanılan önbellek seçeneği.

uriCachePolicy
RequestCachePolicy

Bu BitmapFrameiçin önbelleğe alma gereksinimleri.

Döndürülenler

BitmapFrame Belirtilen BitmapCreateOptions, BitmapCacheOptionve RequestCachePolicyile verilen Uri bir kaynaktan.

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 BitmapMetadata, ve ColorContextile verilenden BitmapSource yeni BitmapFrame 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 BitmapFrameedilen öğesinin küçük resmi.

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 BitmapMetadata, ve ColorContextile verilen BitmapSource bir kaynaktan.

Şunlara uygulanır