Admin@mbox3.magellan-net.de
alina@yourmx.de
bm@schweinischer-bote.de
boris@cosmeta.de
boss@dan2n.de
btiggemann@mbox3.magellan-net.de
catcher009@blacknbeauty.de
Christopher_Zantopp@web.de
dok123@discardmail.com
dominik.keilbach@rocketmail.com
dominik2712@web.de
einkauf@dan2n.de
elke@kunesch.eu
erik_burgbacher_bi17l4lo@send.electronicmailfor.me.uk
feedme@die-bauer.de
feedme@dog-net.org
feedme@drakensang.de-web.cc
feedme@kraffner.de
feedme@schlaegel.it
feedme@sql-kunesch.de
feedme@wipeout6.de
fetcher@open-host.de
frank@spiracyworld.co.uk
getspam@schlaegel-online.de
harun-ali@web.de
iCollectGarbage@gmx.de
ifyoudone@r0ckt.de
ifyyou@r0ckt.de
info@die-bauer.de
info@mbox3.magellan-net.de
info@r0ckt.de
info@rbcms.de
john.deer@spamreducer.eu
john@cannedmeat.elementfx.com
k.tramm@xspin.de
Karl-Heinz.Becher@gmx.de
Kevin.Becaud@bio-muesli.info
kickers88@live.de
knuddels119k@yahoo.de
loremiosumsitdoloramet@yahoo.de
loremiosumsitdoloramet@yahoo.de
lotharwalter@ymail.com
luna@r0ckt.de
matz0302oyqp@domut.de
mgoessel@gmx.net
michael.k@drakensang.de-web.cc
michael.k@drakensang.de-web.cc
michael.k@sql-kunesch.de
michaknopf@googlemail.com
mk@r0ckt.de
msneijder@mbox3.magellan-net.de
nasti_mkorsa@sql-kunesch.de
newcyborg@gmx.net
schlucks@gmx.net
schwarz@die-bauer.de
service@mbox3.magellan-net.de
sp4mf4ng@j-schmitz.net
spam@teh1.de
spamcatcher@spamtrap.dtdns.net
spamela@spamschlucker.org
spamhog.ihatespam@gmail.com
spamlearn@schlarb-it.de
spamlearn@schlarb-it.de
spamtarget@junge-piraten.de
spamtrap@r0ckt.de
spamtrap@sprachdidaktik.org
spoof@dog-net.org
stephan@spamschlucker.org
support@mbox3.magellan-net.de
thanks@marvin-webservice.net
trap.mitschutz@sprachdidaktik.org
trap@sprachdidakt.de
trap@sprachdidaktik.org
trep@marvin-webservice.net
unwanted@shadowpage.de
vertrieb@dan2n.de
wb@munzinger.de
willmehr@drakensang.de-web.cc
willmehr@drakensang.de-web.cc
willmehr@wipeout6.de
wir@dragoncrew.de
xkbzy@grossermist.de
a Image

Here's another part of my Converter Class: this function converts a ৺BitmapSource to an ৺BitmapImage:

Also the Conversation ৺BitmapImage to ৺BitmapSource is included - but its not worth mentioning ;-)
Due to the fact, that ৺BitmapImage inherits ৺BitmapSource, you can simple do an explicit cast on it.

  1.  
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Windows.Media.Imaging;
  7. using System.IO;
  8.  
  9. namespace Dognet.Imaging
  10. {
  11.     partial class Converter
  12.     {
  13.         /// <summary>
  14.         /// Converts an given BitmapSource to an BitmapImage
  15.         /// </summary>
  16.         /// <param name="bitmapSource">the BitmapSource</param>
  17.         /// <returns>the BitmapImage</returns>
  18.         public static BitmapImage BitmapSourceToBitmapImage(BitmapSource bitmapSource)
  19.         {
  20.             JpegBitmapEncoder encoder = new JpegBitmapEncoder();
  21.             MemoryStream memoryStream = new MemoryStream();
  22.             BitmapImage bImg = new System.Windows.Media.Imaging.BitmapImage();
  23.  
  24.             encoder.Frames.Add(BitmapFrame.Create(bitmapSource));
  25.             encoder.Save(memoryStream);
  26.                  
  27.             bImg.BeginInit();
  28.             bImg.StreamSource = new MemoryStream(memoryStream.ToArray());
  29.             bImg.EndInit();
  30.  
  31.             memoryStream.Close();
  32.  
  33.             return bImg;
  34.         }
  35.  
  36.         /// <summary>
  37.         /// Converts a bitmapImage to a bitmapSource
  38.         /// </summary>
  39.         /// <param name="bitmapImage">the bitmapImage to convert</param>
  40.         /// <returns>the bitmap Source</returns>
  41.         public static BitmapSource BitmapImageToBitmapSource(BitmapImage bitmapImage)
  42.         {
  43.             return (BitmapSource)bitmapImage;
  44.         }
  45.     }
  46. }
  47.  

Related Tags:

Stay tuned:

r a t y y

Top 25 Tag-Cloud (last 14 days):

Comments on this post:

Not yet a comment...

Leave a Comment:

Captcha-Code:        reload
Name:
Captcha:
Comment:

Donate!

Like my stuff? Feel free to donate!
 
Modellbau Forum pspad Browser-Statistiken WhatPulse logo dog-net.org Valid XHTML 1.0 Transitional CSS ist valide!

DevelopmentWPF | 2010-02-02 13:07:37

LeadImage

System.Drawing.Bitmap to BitmapImage

Heres a little piece of code to converting a System.DrawingBitmap to the new ৺BitmapImage class.

read more...

Developmentvb.NET | 2010-01-01 16:41:25

LeadImage

Listview onSelectedIndexChanged Event

The ৺.net ListView offers a ৺onSelectedIndexChanged-Event. But if you are selecting another value, the event is fired twice.

read more...

DevelopmentJava | 2009-12-27 18:29:59

LeadImage

Blackberry Environment

Heres a guide about setting up the Environment necessary for developing ৺Java applications for the ৺Blackberry (৺Storm).

read more...

Developmentvb.NET | 2009-12-26 10:59:47

LeadImage

Reading and Writing INI-Files

Heres a little sample, how to read and write ৺ini-files with the ৺.Net-Framework.

read more...

DevelopmentPHP | 2009-10-14 02:08:39

LeadImage

ImageCopyMergeAlpha

The GD-Lib is a very powerfull extension for PHP.

but in one case, it really fails.

read more...

DevelopmentPHP | 2009-08-26 16:35:21

LeadImage

rand or mt_rand?

Random numbers are often useful - but those are these pseudo random numbers really random?

read more...

DevelopmentRegEx | 2009-08-23 20:40:37

LeadImage

Quick-Tipp: Exlude a word from being matched.

Little Example, how to exclude a word from being matched.

read more...

DevelopmentPHP | 2009-08-19 23:27:25

LeadImage

Easy Permission Management System

Heres a sample of a easy ৺permission management system.

read more...

DevelopmentHTML | 2009-07-16 04:11:20

LeadImage

Centering a Div

How to center a div element. There are different ways to center a div-element. but which one is the right?
Which one is cross ৺browser compatible?

read more...

DevelopmentPHP | 2009-07-12 02:30:50

LeadImage

Captcha With Real Tff And Background

Here you can find a ৺captcha code, that uses real tiff fonts as well as random background images. This is a improved version of my older ৺captcha, which completly was made by colors, default fonts and shapes.

read more...

Developmentvb.NET | 2009-07-09 03:26:30

LeadImage

MakeNiceSize() - Rekursive

This is a little vb.net ৺snippet, to create a nice file size

read more...

Developmentvb.NET | 2009-07-09 03:26:21

LeadImage

MakeNiceSize() - Loop

This is a little vb.net ৺snippet, to create a nice file size

read more...

Developmentvb.NET | 2009-07-09 03:26:12

LeadImage

MakeNiceSize() - Custom Size

This is a little vb.net ৺snippet, to create a nice file size

read more...

DevelopmentPHP | 2009-07-09 03:22:13

LeadImage

MySQL Connection Class

A Long time ago, i wrote a Class, that makes ৺SQL-Querys easier. Nearly everything is done without caring about all the PHP ৺SQL-Functions.

read more...

DevelopmentPHP | 2009-07-09 03:22:05

LeadImage

MakeNiceSize

This is the php function, i use to create user friendly file size strings. Sizes like 215742435 byte or 0,00000000023 GB are NOT user friendly.

read more...

DevelopmentPHP | 2009-07-09 03:21:44

LeadImage

Dynamic Style Sheets

Copyright © 2008 - 2010 | by dog.net Development | Imprint | Load in 2.743701