embedded-resource

How to change the default namespace for Embedded Resources with MSBuild?

谁都会走 提交于 2019-11-28 03:23:05
问题 I am attempting to embed an unmanaged dll in my console project. The default namespace of the project is Company.Project1Exe . The Assembly Name (output exe ) is named project1.exe The dlls are added to the project using the Add as Link option and are located in a Libs\x86 subfolder Company.Project1Exe | |--Program.cs |--Libs |--x86 |-My1st.dll |-My2nd.dll They have been added to the project using the Add as Link option, thus are not physically locate in the Libs subfolder. I have set the

Embedded Font Causes a Crash

蓝咒 提交于 2019-11-28 02:22:44
I have a WinForm app. I am using a custom font that is in my embedded resources. It works at first, but then causes the program to crash after a while. Using the following code as an example, if I keep resizing the form, forcing it to constantly redraw itself, it will crash within a few seconds. The message I get is ' Error in 'Form1_Paint()'. Object is currently in use elsewhere. '. What am I doing wrong? How can I avoid this? I got the font from here. Thanks. Imports System.Drawing.Text Imports System.Runtime.InteropServices Public Class Form1 Friend Harabara As Font Private Sub Form1_Load

Java Path ImageIcon URL .JAR

强颜欢笑 提交于 2019-11-28 01:33:18
I may have made of try, none works.. The file is: /Users/Toto/Desktop/Titi/IUT/Java/TP2/project/src/fichierPointJava/img1.png fichierPointJava is the name of the package . I launch the ant when I am situated in project which contains the build.xml Here are the codes that I tested: URL urlImage1=this.getClass().getClassLoader.getResource("/src/fichierPointJava/img1.png"); URL urlImage1=this.getClass().getClassLoader.getResource("/fichierPointJava/img1.png"); URL urlImage1=this.getClass().getClassLoader.getResource("fichierPointJava/img1.png"); URL urlImage1=this.getClass().getClassLoader

FileNotFoundException when trying to load Autofac as an embedded assembly

岁酱吖の 提交于 2019-11-27 23:54:13
Previous versions of Autofac worked, but since they switched to making it a Portable Class Library it won't load. I tried applying the fix listed here (KB2468871) but it told me that it was not needed. The error goes away when I move the Autofac.dll file into the same location as the executable. When it loads it from the external DLL it loads fine. Why won't it work as an embedded DLL? Here is the exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its

How to refer to Embedded Resources from XAML?

╄→尐↘猪︶ㄣ 提交于 2019-11-27 23:28:20
I have several images that i want to be Embedded into the exe. When i set the Build Action to Embedded Resource I get through out the code an error that the Resource isn't available and asking me to set the Build Action to Resource I Tried several different methods : <ImageSource x:Key="Image_Background">YearBook;component/Resources/Images/darkaurora.png</ImageSource> <ImageSource x:Key="Image_Background">Images/darkaurora.png</ImageSource> <ImageSource x:Key="Image_Background">pack://application:,,,/Resources/Images/darkaurora.png</ImageSource> This code sits in a Resource file. But none

Jar Embedded Resources NullPointerException [closed]

牧云@^-^@ 提交于 2019-11-27 23:24:24
I originally started with Chillax, after Encountering so many problems so near to deadline, I went back to the IDE I am more familiar with, NetBeans, and I changed my approach to a more basic "Asteroid"-type game: NBs zip file: http://ge.tt/4T5tBFT/v/0?c text: git clone git://gist.github.com/4248746.git embed?: In NetBeans I get: Exception in thread "main" java.lang.NullPointerException at javax.swing.ImageIcon.<init>(ImageIcon.java:205) at gayme.Craft.<init>(Craft.java:27) at gayme.Board.<init>(Board.java:54) at gayme.Gayme.<init>(Gayme.java:9) at gayme.Gayme.main(Gayme.java:19) Java Result:

Embedded JPG resources not loading in Qt application

╄→尐↘猪︶ㄣ 提交于 2019-11-27 22:27:54
I have a Qt application that has some embedded JPG files that I want to display. When I compile and run both the debug and release versions on my machine, everything works perfectly. When I copy the application to a thumb drive and run it from there on my machine, it works fine. On the thumb drive and another developer's machine: OK. On the thumb drive on a third, non-developer's machine: no images ! proj.pri RESOURCES += ./proj.qrc proj.qrc: <RCC> <qresource prefix="/myApp"> <file>Gui/Resources/logo.jpg</file> <file>Gui/Resources/another_image.jpg</file> </qresource> </RCC> main.cpp: { ...

WPF - Add Custom Font

纵饮孤独 提交于 2019-11-27 20:44:50
问题 I'm trying to add a custom font as a resource in my application. I have a "CustomFont" directory in the application and all the fonts inside of it are set to "Resource" <Window.Resources> <Style x:Key="Gotham-XLight"> <Setter Property="TextElement.FontFamily" Value="/CustomFonts;Component/#Gotham-XLight" /> </Style> </Window.Resources> And then on my TextBlock I have this: (inside a grid) <TextBlock x:Name="TimeTextBlock" Style="{DynamicResource Gotham-XLight}" TextAlignment="Center" FontSize

How to read a resource file within a Portable Class Library?

[亡魂溺海] 提交于 2019-11-27 19:05:58
I have a Portable Library which I am using for a Windows Phone application. In that same Portable Library, I have a couple of content files ( Build Action = Content ). I created a class DataReader in the Portable Library which is supposed to return me a stream to the content file. However, with the code below I am consistently getting back null from GetManifestResourceStream . What am I doing wrong? public class DataReader { public static Stream GetStream(string code) { string path = string.Format("./data/code-{0}.dat", code); return Assembly.GetExecutingAssembly().GetManifestResourceStream

Resource from assembly as a stream

十年热恋 提交于 2019-11-27 19:01:55
I have an image in a C# WPF app whose build action is set to 'Resource'. It's just a file in the source directory, it hasn't been added to the app's resource collection through the drag/drop properties dialog. I'm trying to write it as a stream, but I can't open it despite trying quite a few variations of dots, slashes, namespaces and seemingly everything else. I can access it to use elsewhere either in xaml with "pack://application:,,,/Resources/images/flags/tr.png", but I can't get at a stream containing it. Most places seem to say use using(BinaryReader reader = new BinaryReader(System