473,407 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

pack: URIs ... help!

The .Net "pack URIs" feature seems ideally suited to my C#
application, but I cannot make it work. I hope someone can help.

I have some images (GIF and JPG), which I have built into my library's
DLL, by setting Build Action to Embedded Resource. Using
Assembly.GetManifestResourceNames(), I have verified that they're
there, at run-time.

I have a string containing some generated XML text, representing a
XAML FlowDocument. Within the FlowDocument, there are some <Image>
elements, with Source attributes. These attributes need to point to
the images that I embedded in the DLL.

It seems to me that it should be easy to use pack URIs to do this. I
have verified that Assembly.GetExecutingAssembly() gives the assembly
that contains the images, so I should be able to use either a simple
relative URI (e.g. "/mySubdir/myImage.gif") or a not-too-hard absolute
URI (e.g. "pack://application:,,,/mySubdir/myImage.gif").

If I try either of the above, my program crashes with Access
Violation. As it's a C# managed application, that shouldn't be
possible, should it?

If I try explicitly asking for my particular assembly (e.g. "pack://
application:,,,/MyAssembly;component/mySubdir/myImage.gif"), it
doesn't crash, but it doesn't load the image either. When the
FlowDocument is rendered, there's a blank space where the image should
be.

The problem is definitely to do with the pack URIs, as I can get a
FlowDocument with images, simply by using "file:" URIs. That type of
URI isn't any good for the production system, though, because it ties
the FlowDocument to some arbitrary file location on my PC.
Jun 27 '08 #1
1 2596
On Wed, 16 Apr 2008 03:32:08 -0700, P Chase
<pe*********@globalgraphics.comwrote:
[...]
Please do not multi-post. Learn to cross-post correctly so that your post
and any replies need only be read once, and are visible in each newsgroup
to which you've cross-posted.
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Buck Turgidson | last post by:
I am trying to learn PHP. I am confused as to why I need $_SERVER in the first block, but just $PHP_SELF in the 2nd. I don't see the latter assigned anywhere in the code. Thanks for any...
1
by: Josh | last post by:
Caution, newbie approaching... I'm trying to come up with a very simple Tkinter test application that consists of a window with a drop-down menu bar at the top and a grid of colored rectangles...
4
by: Stacy Mader | last post by:
Greetings all, I have a VMS binary file with weather data. The record on each line is 1xint(8) 12xint(2) Using the perl unpack function, I can decode the binary file like this: <snip>
6
by: Wiktor Zychla | last post by:
I've downloaded the polish language pack for .Net Framework 1.1 and I've installed it. Now I expect to see any exception messages in my native language but I still get english texts in exception...
18
by: jayderk | last post by:
a customer was trying to install some of our software after they installed the windows XP service pack 2 and he is getting a message that says something about it not being compatable with windows...
5
by: H J van Rooyen | last post by:
Hi, I am struggling to get the pack method to do what I intend. I am trying to display user input in a seperate window, along with a little description of the field, something like this: ...
1
by: steene5 | last post by:
I have a Dell computer with Microsoft windows XP home edition. I downloaded Service pack 2 a year ago and my whole computer crashed. It took me a full day to redo my whole computer while I was on...
4
by: Simon Forman | last post by:
Hi all, I realize this is more of a Tk question than a python one, but since I'm using python and don't know Tcl/Tk I figured I'd ask here first before bugging the Tcl folks. I am having a...
0
by: Eric Lindsay | last post by:
I encounter an annoying number of ampersands in URIs I copy and paste into blog style diary entries, written in HTML with a text editor. Does anyone happen to know of reasonably reliable method of...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.