Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

programatically set the content of a label to be a bitmap?

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 06-07-2006   #1 (permalink)
CosminB [BRT]
Guest


 

programatically set the content of a label to be a bitmap?

Hi,

I have two pictures taken periodically from a webcam. I diff the two,
and the result is a Bitmap. I want this Bitmap to be displayed as a
label's Content. How do I do this programatically?

Something like:

label.Content = new System.Windows.Controls.Image(bmp);

(Of course, that's not real code, but you get my point)

Anyone knows how to do this?

Thanks in advance,
Cosmin.


My System SpecsSystem Spec
Old 06-07-2006   #2 (permalink)
Vipin [MVP]
Guest


 

Re: programatically set the content of a label to be a bitmap?

like this:-
public Window1()
{
InitializeComponent();

BitmapImage myBitmapImage = new BitmapImage();
Image myImage = new Image();
myImage.Width = 200;

myBitmapImage.BeginInit();
myBitmapImage.UriSource = new
Uri(@"C:\\windows\\system32\\setup.bmp");
myBitmapImage.EndInit();
myImage.Source = myBitmapImage;

lbl.Content = myImage;
}

--
Vipin Aravind
http://www.explorewindows.com
http://forums.techedindia.com


"CosminB [BRT]" <cosminb@gmail.com> wrote in message
news:1149679327.542328.139320@i39g2000cwa.googlegroups.com...
> Hi,
>
> I have two pictures taken periodically from a webcam. I diff the two,
> and the result is a Bitmap. I want this Bitmap to be displayed as a
> label's Content. How do I do this programatically?
>
> Something like:
>
> label.Content = new System.Windows.Controls.Image(bmp);
>
> (Of course, that's not real code, but you get my point)
>
> Anyone knows how to do this?
>
> Thanks in advance,
> Cosmin.
>



My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Programatically changing JPG Metatags Dzomlija Vista music pictures video 0 01-11-2008 04:38 AM
Programatically disable OWA access ?? voodooking PowerShell 6 12-07-2007 05:22 PM
Set-Content not updating file after get-content and forEach-Object Tolli PowerShell 1 06-14-2007 09:01 PM
Programatically detecting ReadyBoost Hector Vista General 1 02-28-2007 01:44 PM
Weirdness with get-content | replace | set-content - file content is deleted!! Andrew Watt [MVP] PowerShell 4 05-23-2006 05:59 PM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51