标签: ico

Spring mvc:资源找不到*.ico文件

我很难让我的Spring 3.0应用程序将favicon.ico类型文件识别为资源.我在我的spring-context.xml文件中定义了我的资源目录,如下所示:

<mvc:resources mapping="/ui/**" location="/ui/" />
Run Code Online (Sandbox Code Playgroud)

此目录结构如下所示:

/ui
  /images
  /styles
  /scripts
  ...
Run Code Online (Sandbox Code Playgroud)

Spring可以很好地托管我的图像,脚本和样式.但是,尝试检索*.icoimages目录中的任何文件时出现404错误.所有PNG,GIF和JPG图像在同一目录中都可以正常工作.我尝试更具体地说明要托管哪些目录,甚至指定.ico文件作为文件中的资源context.xml,仍然得到相同的结果:

<mvc:resources mapping="/ui/images/*.ico" location="/ui/images" />
Run Code Online (Sandbox Code Playgroud)

我也尝试将servlet映射添加到默认的servlet.当我在网上进行研究时,这似乎对某些人有用,但对我来说并没有证明是成功的.

<servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.ico</url-pattern>
</servlet-mapping>
Run Code Online (Sandbox Code Playgroud)

编辑:我还将favicon.ico文件添加到Web应用程序的根路径.如果我使用一个png文件作为favicon,它适用于每个浏览器,但IE.如果可能的话,我想为所有浏览器解决这个问题.在这一点上任何帮助将不胜感激.

EDIT2:我已经在XHTML文档中有一个链接标记:

<link rel="shortcut icon" type="image/vnd.microsoft.icon" href="/ui/images/favicon.ico" />
Run Code Online (Sandbox Code Playgroud)

java favicon spring spring-mvc ico

13
推荐指数
1
解决办法
6207
查看次数

选定的TabItem中的图像不清晰

我有一个TabControl.每个TabItem的标题包含一个带有图标和Label的StackPanel.

<TabControl>
  <TabItem>
    <TabItem.Header>
      <StackPanel Orientation="Horizontal">
        <Image Source="/LoginPanel;component/Icons/icoLogin.ico"</Image>
        <Label VerticalContentAlignment="Center">Login</Label>
        </StackPanel>
      </TabItem.Header>
    </TabItem.Header>
    <!--some further code here-->
  <TabItem>
  <!--some further code here-->
<TabControl>
Run Code Online (Sandbox Code Playgroud)

每个未选择的TabItem中的每个图标都按预期显示.当前所选TabItem中的图标有些混浊.如果我切换到另一个标签,取消选择的标签图标变得清晰; 新选择的图标变为阴天.

我已经尝试过以下方法来解决这个问题:

SnapsToDevicePixels="True"
Run Code Online (Sandbox Code Playgroud)

但没有任何反应

要么

Width="32" Height="32"
Run Code Online (Sandbox Code Playgroud)

要么

Stretch="None"
Run Code Online (Sandbox Code Playgroud)

防止缩放.所有这些都没有任何影响.有人可以给我一个提示吗?提前致谢

wpf icons tabcontrol ico tabitem

11
推荐指数
2
解决办法
1254
查看次数

编写ico文件java

最近我对在java中创建.ico文件或Windows图标文件感兴趣.这是我使用的当前代码.我从这里获得了文件格式规范http://en.wikipedia.org/wiki/ICO_%28file_format%29

    BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_RGB);
    Graphics g = img.getGraphics();
    g.setColor(Color.GREEN);
    g.fillRect(0, 0, 16, 16);
    byte[] imgBytes = getImgBytes(img);
    int fileSize = imgBytes.length + 22;
    ByteBuffer bytes = ByteBuffer.allocate(fileSize);
    bytes.order(ByteOrder.LITTLE_ENDIAN);
    bytes.putShort((short) 0);//Reserved must be 0
    bytes.putShort((short) 1);//Image type
    bytes.putShort((short) 1);//Number of image in file
    bytes.put((byte) img.getWidth());//image width
    bytes.put((byte) img.getHeight());//image height
    bytes.put((byte) 0);//number of colors in color palette
    bytes.put((byte) 0);//reserved must be 0
    bytes.putShort((short) 0);//color planes
    bytes.putShort((short) 0);//bits per pixel
    bytes.putInt(imgBytes.length);//image size
    bytes.putInt(22);//image offset
    bytes.put(imgBytes);
    byte[] result = …
Run Code Online (Sandbox Code Playgroud)

java ico

10
推荐指数
2
解决办法
3014
查看次数

从独立于开源平台的Java代码替换Windows*.exe中的图标

首先,这与从Java类生成EXE的常见问题不重复.我不需要这样做.

要解决NetBeans RFE#64612而不需要手动步骤,我需要一个Java(6+)库,它可以获取现有的 Windows *.exe文件,并用通用格式的替代品替换其图标.可执行文件是通用的并且是预构建的(以二进制形式分发),已经知道如何加载特定于应用程序的配置文件,然后使用各种应用程序JAR等启动JRE.唯一的问题是它有一个通用图标,我想将该图标替换为纯Java构建的一部分,并带有特定于应用程序的图标,因此它看起来更漂亮.

该库必须在非病毒开源许可下提供; 跨平台(必须在Windows,Linux,Mac,Solaris上运行),因此无法分叉某些特定于操作系统的帮助工具; 并且必须接受PNG输入,尽管EXE必须在XP上工作,因此根据Wikipedia应该嵌入BMP格式.在高层次上,假设Ant作为构建工具,我想要这样的东西:

<replaceicon from="app.exe" to="hello.exe" icon="hello.png"/>

有谁知道是否已经存在符合这些规范的工具?从各种网络搜索,我发现Launch4J,但这似乎只是叉windres的实际工作,因此不平凡的便携性.我发现JSmooth看起来更有前途 - 似乎包含用于处理ICO编解码器和操作PE文件的Java代码 - 但它是GPL.WinRun4J看起来使用本机代码进行图标操作,尽管我很难跟踪它的来源.据说Jimi处理ICO格式(标准javax.imageio似乎也是如此),但我想没有更新PE资源的工具.

java exe bmp ico portable-executable

9
推荐指数
1
解决办法
1576
查看次数

.ico图标未显示在Windows上

我遵循了Qt资源系统指南,并且.ico图标出现在Linux上.

当我尝试从Qt Creator运行应用程序时,图标不会显示在Windows上.

怀疑基于Qt/C++的插件问题:在Windows操作系统下运行程序时图标没有显示但我没有弄清楚如何创建Qt插件指南.

它是插件问题还是为什么不在Windows上显示图标?

如果是插件问题:如何告诉我的应用程序在哪里可以找到qico.dll?


环境细节:

适用于:Kubuntu 12.04 LTS,Qt Creator 2.4.1和Qt 4.7.4(64位)

失败:Windows XP SP2 32位,Qt Creator 2.4.1和Qt 4.7.4(32位)

Everyting是默认的(开箱即用),我没有弄乱设置.

resources.qrc

<!DOCTYPE RCC><RCC version="1.0">
    <qresource>
        <file>images/spreadsheet.ico</file>
    </qresource>
</RCC>
Run Code Online (Sandbox Code Playgroud)

也尝试过<qresource prefix="/">.

来自applicaton.pro

RESOURCES += \
    resources.qrc

OTHER_FILES += \
    images/spreadsheet.ico
Run Code Online (Sandbox Code Playgroud)

在相应的源文件中

QIcon(":/images/spreadsheet.ico")
Run Code Online (Sandbox Code Playgroud)

我也尝试过在Windows上部署应用程序

QDir plugins(QCoreApplication::applicationDirPath()+"/plugins");

qDebug() << "Plugin directory" << plugins.absolutePath() << "found?" << plugins.exists();

app.addLibraryPath(plugins.absolutePath());
Run Code Online (Sandbox Code Playgroud)

使用插件目录中的qico.dll.它应用程序打印出plugins目录,但图标仍未显示.

我再说一遍:它适用于Linux.

plugins icons qt toolbar ico

9
推荐指数
1
解决办法
7091
查看次数

Favicon在IE11中不起作用;适用于FF和Chrome

问题

(我的收藏夹图标已经在Firefox和Chrome中工作。)在Internet Explorer 11(我的版本)中,我似乎无法使d * ng收藏夹图标正常工作。我将文件存储为.ico,并且还有Firefox的备用文件,因为您可以在其中使用64x64 .png。它显示IE具有页面的默认图标。

资讯

Windows版本-10
Internet Explorer版本-11
图标文件类型-.ico

剧本

<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="shortcut" type="image/x-icon" href="favicon.ico">
Run Code Online (Sandbox Code Playgroud)

html windows favicon ico internet-explorer-11

9
推荐指数
1
解决办法
7521
查看次数

JavaFX 2.2对.ico的图像支持?

我正在开发一个必须有自定义图标的应用程序.所提供的图标在所有尺寸(256x256,48x48,32x32)中都是相同的,除了在16x16中图标被简化.

我想到了.ico格式(我可以存储所有不同的图标并让操作系统显示最佳)但javafx.scene.image似乎没有支持它(我还没有找到任何关于它的确认) ).

以下是我设置图标的方法

stage.getIcons().add(new Image(getClass().getResourceAsStream("/path/to/icon.ico")));
Run Code Online (Sandbox Code Playgroud)

在这种情况下,永远不会显示图标.如果我将此图标转换为.png图像,则可以使用,但强制始终显示相同的图标(即使在16x16中).

在JavaFX 2.2中是否有一种方法可以显示.ico(即使是以hacky方式),还是我必须使用其他图像格式?

更新

我将.ico分成多个png(每个大小一个),然后逐个加载它们.

stage.getIcons().add(new Image(getClass().getResourceAsStream("/path/to/icon_16x16.png")));
stage.getIcons().add(new Image(getClass().getResourceAsStream("/path/to/icon_256x256.png")));
Run Code Online (Sandbox Code Playgroud)

256x256和16x16是两个不同的图像,但16x16从未显示在应用程序的左上角(尽管这是最接近的大小).

image ico javafx-2

7
推荐指数
2
解决办法
3511
查看次数

在 WhatsApp 中共享时显示网站图标

标题可能听起来很模糊,但我希望我的网站图标在我分享时显示在 WhatsApp 中(如下例所示)。

在此输入图像描述

认为这就足够了,但显然它不是这样工作的:

<link rel="shortcut icon" href="css/img/favicon/favicon.ico" type="image/x-icon"/>

编辑

快速阅读 OpenGraph 文档(及其他评论)后。我在脑海中添加了以下内容:

<meta name="robots" content="noindex, nofollow" />
...
<meta property="og:title" content="Website - Home" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://mywebsite.com/" />
<meta property="og:image" content="https://mywebsite.com/img/favicon/android-icon-192x192.png" />

<link rel="apple-touch-icon" sizes="57x57" href="img/favicon/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="img/favicon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="img/favicon/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="img/favicon/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="img/favicon/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="img/favicon/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="img/favicon/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="img/favicon/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="img/favicon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192"  href="img/favicon/android-icon-192x192.png">
<link rel="icon" …
Run Code Online (Sandbox Code Playgroud)

html css ico whatsapp

7
推荐指数
1
解决办法
2万
查看次数

如何包含一次可用于可执行文件和表单的图标?

.ico我尝试对应用程序可执行文件和应用程序内的表单使用单个文件(具有多种大小),而不在可执行文件中包含两次图标。

我注意到这一点是因为我的应用程序(没有图标)编译为 600KB,图标为 300KB,但是当我使用这两个应用程序时,编译的应用程序增加到 1200KB,表明它被嵌入了两次。

这是我尝试过的:

(1) 使用UI选取图标文件

  1. 转到“应用程序属性”>“应用程序”>“资源”>“图标”,然后使用“...”按钮选择MyIcon.ico文件。
    • 编译后的exe现在是900KB
  2. 转到“表单属性”>“图标”并使用“...”按钮选择MyIcon.ico文件。
    • 编译后的exe现在是1200KB

(2)使用资源

  1. 转到应用程序属性 > 资源 > 图标 > 添加现有文件并选择MyIcon.ico文件
  2. 在表单构造函数中添加:this.Icon = Properties.Resources.MyIcon;
    • 编译后的exe现在是900KB
  3. 转到“应用程序属性”>“应用程序”>“资源”>“图标”,然后选择Resources\MyIcon.ico(在下拉列表中列出)
    • 编译后的exe现在是1200KB

显然,它仍然第二次包含该文件,而不是引用嵌入资源。

(3) 使用Icon.ExtractAssociatedIcon()

  1. 转到“应用程序属性”>“应用程序”>“资源”>“图标”,然后使用“...”按钮选择MyIcon.ico文件。
    • 编译后的exe现在是900KB
  2. 在表单构造函数中,添加this.Icon = Icon.ExtractAssociatedIcon(AppDomain.CurrentDomain.FriendlyName);
    • 编译后的exe仍然是900KB,但图标是Windows中的通用“exe”图标,而不是我的应用程序的图标

在我深入探讨这个问题之前,我是否遗漏了一些明显的东西?有没有标准的方法来做到这一点?难道只是我使用Icon.ExtractAssociatedIcon()不当?

c# embedded-resource ico winforms

6
推荐指数
1
解决办法
4597
查看次数

如何通过 web3 js 提高我的 erc20 代币价格?

如何提高我的 erc20 代币价格?当我从 Etherscan 看到 BNB 代币时,我可以看到价格,但我的代币价格显示 0 美元。我怎样才能提高价格?

在 Binacne 平台中,BNB 代币买卖发生,然后利率显示在以太坊中。 .js。

ico erc20

6
推荐指数
0
解决办法
352
查看次数