Click here to Skip to main content
15,908,909 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: WPF - basic data binding and "Save" x "Cancel changes" Pin
Pete O'Hanlon13-Sep-11 22:59
mvePete O'Hanlon13-Sep-11 22:59 
GeneralRe: WPF - basic data binding and "Save" x "Cancel changes" Pin
Member 103390714-Sep-11 2:05
Member 103390714-Sep-11 2:05 
GeneralRe: WPF - basic data binding and "Save" x "Cancel changes" Pin
Pete O'Hanlon14-Sep-11 2:15
mvePete O'Hanlon14-Sep-11 2:15 
GeneralRe: WPF - basic data binding and "Save" x "Cancel changes" Pin
Mycroft Holmes13-Sep-11 23:27
professionalMycroft Holmes13-Sep-11 23:27 
GeneralRe: WPF - basic data binding and "Save" x "Cancel changes" Pin
Pete O'Hanlon14-Sep-11 23:13
mvePete O'Hanlon14-Sep-11 23:13 
QuestionCall the client program Pin
luozi20114-Sep-11 14:55
luozi20114-Sep-11 14:55 
AnswerRe: Call the client program Pin
Pete O'Hanlon4-Sep-11 20:08
mvePete O'Hanlon4-Sep-11 20:08 
QuestionConverting an Bitmap to ImageSource problem Pin
Mike Hankey4-Sep-11 10:31
mveMike Hankey4-Sep-11 10:31 
Dear Abby,

I have a bitmap that I am displaying on an Expander header.

XML
<Image Source="{Binding TaskType, Converter={StaticResource ImageConverter}}" />


using the following ValueConverter

public object Convert(object value, Type targetType,
     object parameter, CultureInfo culture)
{
      System.Drawing.Image img = global::ToDoManager.Properties.Resources.Pencil;

      var bitmap = new System.Windows.Media.Imaging.BitmapImage();

       bitmap.BeginInit();
       MemoryStream stream = new MemoryStream();
       img.Save(stream, ImageFormat.Bmp);
       stream.Seek(0, SeekOrigin.Begin);
       bitmap.StreamSource = stream;
       bitmap.EndInit();

       stream.Dispose();

       return bitmap;
}


which is working except that the transparent area is black. I guess I need something, encoder maybe to preserve
the transparency. It's like when I'm creating the new BitmapImage it creates it without an Alpha channel.
I've googled but everything I've found leads to this solution and people admit there's a problem but no one
has offered a solution.

Jangled in Jacksonville
C'est What?

AnswerRe: Converting an Bitmap to ImageSource problem Pin
RichardGrimmer5-Sep-11 5:25
RichardGrimmer5-Sep-11 5:25 
GeneralRe: Converting an Bitmap to ImageSource problem Pin
Pete O'Hanlon5-Sep-11 5:30
mvePete O'Hanlon5-Sep-11 5:30 
GeneralRe: Converting an Bitmap to ImageSource problem Pin
RichardGrimmer5-Sep-11 5:33
RichardGrimmer5-Sep-11 5:33 
GeneralRe: Converting an Bitmap to ImageSource problem Pin
Pete O'Hanlon5-Sep-11 5:37
mvePete O'Hanlon5-Sep-11 5:37 
GeneralRe: Converting an Bitmap to ImageSource problem Pin
Mike Hankey5-Sep-11 9:57
mveMike Hankey5-Sep-11 9:57 
AnswerRe: Converting an Bitmap to ImageSource problem Pin
Pete O'Hanlon5-Sep-11 5:37
mvePete O'Hanlon5-Sep-11 5:37 
GeneralRe: Converting an Bitmap to ImageSource problem [modified] Pin
Mike Hankey5-Sep-11 10:05
mveMike Hankey5-Sep-11 10:05 
GeneralRe: Converting an Bitmap to ImageSource problem Pin
Pete O'Hanlon5-Sep-11 20:16
mvePete O'Hanlon5-Sep-11 20:16 
QuestionWPF Pin
mumshad3-Sep-11 20:53
mumshad3-Sep-11 20:53 
AnswerRe: WPF Pin
Abhinav S3-Sep-11 21:02
Abhinav S3-Sep-11 21:02 
QuestionVisual Web Developer express 2010 Pin
arkiboys1-Sep-11 20:51
arkiboys1-Sep-11 20:51 
AnswerRe: Visual Web Developer express 2010 Pin
Abhinav S1-Sep-11 21:00
Abhinav S1-Sep-11 21:00 
GeneralRe: Visual Web Developer express 2010 Pin
arkiboys1-Sep-11 22:07
arkiboys1-Sep-11 22:07 
GeneralRe: Visual Web Developer express 2010 Pin
Abhinav S1-Sep-11 22:29
Abhinav S1-Sep-11 22:29 
AnswerRe: Visual Web Developer express 2010 Pin
Columbus-MCSD2-Sep-11 4:37
Columbus-MCSD2-Sep-11 4:37 
QuestionWpf Pin
radhika 51-Sep-11 18:57
radhika 51-Sep-11 18:57 
AnswerRe: Wpf Pin
Abhinav S1-Sep-11 21:17
Abhinav S1-Sep-11 21:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.