embedded-resource

Embedding Third Party Fonts as resource for Win32 Application

前提是你 提交于 2019-12-06 06:45:00
问题 I was wondering how i can embed a third party font into my app( and use it ) so i can distribute my app with the font of my choice for users who do not have the font installed on their systems. Is this possible, or do i have to distribute the font if i want the users to be able to use the font in question. Thanks. 回答1: Stick the actual font file into a User-Defined Resource. 回答2: Very few fonts will have a license that allows this. Even a free font should be checked. You can use

Embedded resource font in C# does not work correctly

ⅰ亾dé卋堺 提交于 2019-12-06 04:43:16
问题 I embedded a .ttf font file ("Amatic Bold", specifically) in my resources and I'm using this code below to get the Font. I tried the code fom this post: How do I Embed a font with my C# application? (using Visual Studio 2005) This is my implementation: static public Font GetCustomFont (byte[] fontData, float size, FontStyle style) { if (_fontCollection == null) _fontCollection = new PrivateFontCollection(); IntPtr fontPtr = System.Runtime.InteropServices.Marshal.AllocCoTaskMem(fontData.Length

Displaying Icons stored as resources with alpha using GDIPlus (WIn32 C++)

二次信任 提交于 2019-12-06 03:40:17
I have an icon with partial alpha (alpha values between 0 and 255) that I want to display using GDIPlus. When using the Bitmap constructor of GDI+ that takes the direct filename, the file displays properly. However, when loading from resource, it has a problem recognizing alpha. I looked on MSDN, and there are problems with alpha: http://msdn.microsoft.com/en-us/library/windows/desktop/ms536318.aspx . By retrieving the ICONINFO structure from the Icon, I can get rid of the fully transparent pixels, however, the partially transparent pixels still appear either as fully opaque or fully

image problem in wpf (image does not show up)

江枫思渺然 提交于 2019-12-06 03:19:32
问题 I don't understand why I cannot display an image in WPF. Maybe I modified my resources folder accidentally and that is the reason why I does not get displayed. So I created a new wpf application and I have this: and when I run the program my picture gets displayed as: Why is it that when I try doing the same thing in my program the image does not show up!? note how when I run the program there is no image... In my other application I just dragged the image control to my main window and then I

JButton Image Icon not displaying .png file

梦想的初衷 提交于 2019-12-06 01:53:55
I've been looking everywhere for a solution to this and read some similar posts related to this problem but none of them worked for me. I'm trying to display the image "b.png" on the JButton and when i roll over the button the icon changes. package GUI_JButton; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JOptionPane; public class Gui extends JFrame { private JButton reg; private JButton custom; public Gui() {

Java Exception Reading Stream from Resource .wav

删除回忆录丶 提交于 2019-12-05 20:43:46
I guess my code is okay, and my .jar file its okay with the .wav inside it.. But when I try to load it using getResourceAsStream I get a error.. this is my error: java.io.IOException: mark/reset not supported at java.util.zip.InflaterInputStream.reset(Unknown Source) at java.io.FilterInputStream.reset(Unknown Source) at com.sun.media.sound.SoftMidiAudioFileReader.getAudioInputStream(Unkno wn Source) at javax.sound.sampled.AudioSystem.getAudioInputStream(Unknown Source) at operation.MainWindowOperations.prepareAudio(MainWindowOperations.java :92) at operation.MainWindowOperations.<init>

Make resources inaccessible for user

℡╲_俬逩灬. 提交于 2019-12-05 19:38:47
I've written a game in C/C++ which is soon ready to be released. My question is: what would be a good way to make the resources (images/sound etc) inaccessible to the user? It doesn't have to be a strong encryption, I just don't want the average player to browse the resource folders. As of now the resources are not linked in the Visual Studio project, they are loaded from a path. HonkyTonk A simple way to handle it would be to compress all the files into a password protected ZIP file that you unzip in memory (onto a memory based file system if you want to be fancy). The obvious drawback is

Generating Resx files for MVC

情到浓时终转凉″ 提交于 2019-12-05 15:37:34
We use resx files for globalization, along with database lookups for things that can be configured (such as tab names, which can be different by product) by our CS staff, and thus aren't known at design-time. I created a custom tool that reads resx files and intelligently dumps the key/value pairs into a relational database (matching values so we don't have duplicates). This has been a big help to our business - we don't have to send each resx for translation (and pay for duplicate translations of shared words) and we have a 'gold standard' with all our translations (in the database). The tool

Embedded Binary Resources - how can I enumerate the image files embedded?

青春壹個敷衍的年華 提交于 2019-12-05 14:54:12
I was following the instructions in this book , chapter on Resources etc. and what I can't quite figure out is, how do I replace this: images.Add(new BitmapImage(new Uri(@"/Images/Deer.jpg", UriKind.Relative))); images.Add(new BitmapImage(new Uri(@"/Images/Dogs.jpg", UriKind.Relative))); images.Add(new BitmapImage(new Uri(@"/Images/Welcome.jpg", UriKind.Relative))); by a loop that would simply run through all embedded image resources to avoid hard-coding the image names and paths. How would I go about discovering the names of the embedded files? I did select the images I wanted to embed and

How do I call a javascript file that's embedded in a dll in my asp.net web application?

强颜欢笑 提交于 2019-12-05 10:46:24
In a library I am building for my asp.net, is it possible to embed a javascript file as an embedded resource and still be able to retrieve it via a URL call and/or script tag without creating a secondary ashx just to load the javascript? It's entirely possible. A quick google came up with this really good tutorial Managing Your JavaScript Library in ASP.NET 来源: https://stackoverflow.com/questions/13608388/how-do-i-call-a-javascript-file-thats-embedded-in-a-dll-in-my-asp-net-web-appli