Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Icons in TIWURLWindow
#1
Hi Alexandere,

i want to cache .jpg, .png, .gif and .ico graphics in a TIWURLWindow component.

Unfortunately, this only works with the first 3 graphic types.

Icons are NOT displayed in the TIWURLWindow component, instead the graphics file is downloaded to the user's machine without prompting.

Is there an explanation ?

Regards
Jürgen


Attached Files
.zip   IconInURLWindow.zip (Size: 24.9 KB / Downloads: 2)
Reply
#2
The ICO file format is basically a Windows only thing and it's not a web standard. Don't use ICO files in your applications to represent images. There is no guarantee that the browser will support that ICO file. Prefer PNG, JPG and WEBP file formats (I wouldn't recommend GIF either, unless you need animation).
Reply
#3
Thanks for the answer, my example is probably unsuitable for displaying this file format in this way.

The ICO file format is safe to use for favicons according to HTML standard.

But other file formats can also be used for favicons if the size is specified.

<!DOCTYPE html>
<html>
<head>
  <title>My Page Title</title>
  <link rel="icon" type="image/x-icon" href="/images/favicon.ico">
</head>
<body>

</body>
</html>
Reply
#4
The favicon.ico is the only place where .ico files are effectively used in the web, more for historical reasons than anything else. If you copy a file named favicon.ico to the wwwroot folder, IntraWeb will serve it as the icon for your application, if the browser requests it (the browser requests for it automatically, there is no need to specify that in your HTML).
Reply
#5
I only use the ICO file format in HTML files for favicon.ico.

But I need an easy way to display different media files (image, video, audio) from the server and for that I wanted to use TIWURLWindow.
Reply
#6
I also prefer that icons display like the other images.  I tried https://google.com/favicon.ico and it displays correctly.  Adding "SameText(xExt, '.ICO') or" to the end of line 258 in IWMimeTypes.pas might fix it.
Reply
#7
I'm using C++Builder, so i can't compile any Delphi file.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)