SORU
18 EYLÜL 2008, PERŞEMBE


Bir sistemden bir WPF Bitmapİmage yük.Çizim.Bitmap

System.Drawing.Bitmap bir örneği var ve System.Windows.Media.Imaging.BitmapImage şeklinde WPF uygulamam için kullanılabilir yapmak istiyorum.

Bunun için en iyi yaklaşımın ne olurdu?

CEVAP
1 Temmuz 2009, ÇARŞAMBA


MemoryStream nasıl yükleniyor?

using(MemoryStream memory = new MemoryStream())
{
    bitmap.Save(memory, ImageFormat.Png);
    memory.Position = 0;
    BitmapImage bitmapImage = new BitmapImage();
    bitmapImage.BeginInit();
    bitmapImage.StreamSource = memory;
    bitmapImage.CacheOption = BitmapCacheOption.OnLoad;
    bitmapImage.EndInit();
}

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • BMG Rentals Property Management

    BMG Rentals

    23 Mayıs 2011
  • Hak5DarrensVlog

    Hak5DarrensV

    11 EYLÜL 2009
  • pjtoohot

    pjtoohot

    15 NİSAN 2008