embedded-resource

Adding fonts to Swing application and include in package

耗尽温柔 提交于 2019-12-04 16:51:04
问题 I need to use custom fonts (ttf) in my Java Swing application. How do I add them to my package and use them? Mean while, I just install them in windows and then I use them, but I don't wish that the usage of the application will be so complicated, it`s not very convenient to tell the user to install fonts before using my application. 回答1: You could load them via an InputStream : InputStream is = MyClass.class.getResourceAsStream("TestFont.ttf"); Font font = Font.createFont(Font.TRUETYPE_FONT,

How to change windows exe file's icon in linux without wine?

徘徊边缘 提交于 2019-12-04 13:48:37
I know I can use ResHacker to change a resource from windows and I know I can use ResourceUpdate function to do the same problematically (again in windows). My problem is that I have to update the icon of a windows exe file in linux, without using wine. (the reason for not using wine is that this process should run on an automation server that change the files and sign them). I don't know even where to start from. You can change a files metadata like this: gvfs-set-attribute '/path/to/file' -t stringv metadata::custom-icon "/path/to/image.png" There's a program called windres that should suit

iTextSharp - How to input image (PNG) from project resource?

白昼怎懂夜的黑 提交于 2019-12-04 12:42:12
I have iTextSharp creating a pdf for me in VB.net. Everything was working famously, except now I want to embed an image. I tried this: Dim test = My.Resources.MyImage Dim logo = Image.GetInstance(test) This an error though: 'GetInstance' cannot be called with these arguments It appears as though it expects a path, and is getting a System.Drawing.Bitmap type. Is there any way that I can add a project resource image to my PDF? Thanks in advance! One of the overloads for iTextSharp.text.Image.GetInstance() takes an System.Drawing.Image , so convert your PNG resource into this type and then use

Embedding Third Party Fonts as resource for Win32 Application

帅比萌擦擦* 提交于 2019-12-04 11:50:18
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. Stick the actual font file into a User-Defined Resource . Very few fonts will have a license that allows this. Even a free font should be checked. You can use CreateScalableFontResource and AddFontResource to make a font file available to your application. The font must be available

Using JQuery as an ASP.NET embedded webresource

我与影子孤独终老i 提交于 2019-12-04 10:48:48
问题 I have an ASP.NET server control which relies on JQuery for certain functionality. I've tried to add as a webresource. My problem is my method of including the jquery file adds it to the body, or the form to be exact: this.Page.ClientScript.RegisterClientScriptInclude(...) The alternative to this is to add it as a literal in the head tag: LiteralControl include = new LiteralControl(jslink); this.Page.Header.Controls.Add(include); The problem with this however is any existing code srcs in the

How does Vista generate the icon for documents associated to my application?

耗尽温柔 提交于 2019-12-04 10:11:48
Can I affect the process? I have an application built in .NET 3.5 / VS2008. I have embedded multiple icons into the app with a win32 .res file. This is done in the Properties box for the Project in VS2008 - instead of specifying an .ico file, tick the box to specify a .res file. In the .res file you can have multiple icons. See here for what I mean. Each icon includes a 256x256xRGB (PNG Cmopressed) "Vista grade" image, a 256x256x32bit image, and the usual cascade of 48x48, 32x32, and 16x16 images in various color combos. If I view the resulting exe in Explorer, I see the big beautiful 256x256

Embedded resource font in C# does not work correctly

陌路散爱 提交于 2019-12-04 09:33:10
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); System.Runtime.InteropServices.Marshal.Copy(fontData, 0, fontPtr, fontData.Length); _fontCollection

image problem in wpf (image does not show up)

不想你离开。 提交于 2019-12-04 08:42:30
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 browsed for a random image on my computer and when I complied and run it it works fine. Why is it that

Embedding background images in an e-mail

谁说我不能喝 提交于 2019-12-04 06:39:22
I'm trying to use an embedded image in an e-mail as the background image, i've got the following code to embed it: LinkedResource backgroundLink = new LinkedResource("..\\..\\background.gif"); backgroundLink.ContentId = "BackgroundImage"; backgroundLink.TransferEncoding = System.Net.Mime.TransferEncoding.Base64; htmlView.LinkedResources.Add(backgroundLink); m.AlternateViews.Add(htmlView); Then in the e-mail body i've got the following code to test: <table background='cid:BackgroundImage'> <tr> <td> test </td> </tr> </table> It doesn't display, but when i put it in as an image like this is is

Black background in full screen with embedded SketchFab

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 06:38:47
问题 Model URL: https://skfb.ly/KxQr Browser: Chrome 47.0.2526.111 Description of problem My problem to do with embedding my model in my personal website. I made a simple HTML file to demonstrate the problem. <!DOCTYPE html> <html> <body bgcolor="#E6E6FA"> <iframe width="700" height="500" src="https://sketchfab.com/models/26f4959eb49b4eaa98044e8f053acc2d/embed?autospin=0.1&autostart=1&amp&preload=1&transparent=1&scrollwheel=0&ui_stop=0" frameborder="0" allowfullscreen mozallowfullscreen="true"