[IronPython] Can't Get an Image on a Button Ipy Silverlight
Andrew Evans
andrew.canit at gmail.com
Wed Jan 6 02:15:59 CET 2010
I am still having problems. I don't think its a pathing issue but the Images
don't display because I tried:
"/images/stop.jpg"
"images/stop.jpg"
and placing the images in the same folder
"stop.jpg"
here is a chunk of my code
from System.Windows.Controls import Button, Orientation, StackPanel
from System import Uri, UriKind
from System.Windows.Media.Imaging import BitmapImage
..................
self.stopB = Button()
self.stopB.Width = 25
self.stopB.Height = 20
self.stopB.Content = BitmapImage(Uri("/images/stop.jpg",
UriKind.Relative))
.....................
On Tue, Jan 5, 2010 at 1:10 PM, Jimmy Schementi <
Jimmy.Schementi at microsoft.com> wrote:
> I think BitmapImage is what you’re looking for:
>
>
>
> from System import Uri, UriKind
>
> from System.Windows.Controls import Button
>
> from System.Windows.Media.Imaging import BitmapImage
>
>
>
> stopB = Button()
>
> stopB.Content = BitmapImage(Uri("images/stop.jpg", UriKind.Relative))
>
>
>
> ~js
>
>
>
> *From:* users-bounces at lists.ironpython.com [mailto:
> users-bounces at lists.ironpython.com] *On Behalf Of *Andrew Evans
> *Sent:* Tuesday, January 05, 2010 12:44 PM
> *To:* users at lists.ironpython.com
> *Subject:* [IronPython] Can't Get an Image on a Button Ipy Silverlight
>
>
>
> I have been trying for two days now and can't seem to get it right. It
> doesn't help that Silverlight returns no errors
>
> Can any one help me figure out how to use an image as a Button in
> Silverlight
>
> some code I have tried
>
> self.stopB = Button() # stop button
> imageSource = Uri("images/stop.jpg", UriKind.Relative)
> stopImage = Image()
> stopImage.Source = imageSource
> self.stopB.Content = stopImage
>
> Cheers
>
> Andrew
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100105/cc656be7/attachment.html>
More information about the Ironpython-users
mailing list