Codejock Forums Homepage
Forum Home Forum Home > General > XAML Snippets
  New Posts New Posts RSS Feed - XAML Image from code
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

XAML Image from code

 Post Reply Post Reply
Author
Message
Steve28 View Drop Down
Newbie
Newbie


Joined: 10 August 2010
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote Steve28 Quote  Post ReplyReply Direct Link To This Post Topic: XAML Image from code
    Posted: 10 August 2010 at 2:56pm

I'm trying to load an image that is contained in a zip archive without unpacking it to a temporary location. I can load the image programmatically, does anyone know if there's a way i can set the Image Source to a bitmap/ole handle at run-time.

<Image Width="64" Height="64" Source="file://C:\Research\Images\Png\Explorer.png"/>  really this will be in a zip archive
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 19 August 2010 at 2:14pm
I haven't tried it, but if you are using the MarkupLabel control to display your XAML, take a look at the .Icons.AddBitmap and .Icons.AddIcon methods. They accept a handle parameter, and a Command number for the icon. Then in the source attribute of your XAML, use the Command number of the icon that you added instead of file://...


Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
markr View Drop Down
Senior Member
Senior Member


Joined: 01 August 2004
Status: Offline
Points: 443
Post Options Post Options   Thanks (0) Thanks(0)   Quote markr Quote  Post ReplyReply Direct Link To This Post Posted: 20 August 2010 at 10:25am
See the markup sample project. It uses XTPImageManager() to load images and assign them an ID. You can then reference that ID in your markup.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.258 seconds.