Default file image
-
Does anyone know if there is a way of getting the default image of a file to show in a file browser. ie .txt image will be notepad etc. Is there a way of finding this from "System.io.DirectoryInfo" or is there some other way i could retrieve this name. I can then display the correct type of image for the file in my browser )
UI.Entry(Image.FromFile("FolderFull_125x125.png"
Thanx George
-
Does anyone know if there is a way of getting the default image of a file to show in a file browser. ie .txt image will be notepad etc. Is there a way of finding this from "System.io.DirectoryInfo" or is there some other way i could retrieve this name. I can then display the correct type of image for the file in my browser )
UI.Entry(Image.FromFile("FolderFull_125x125.png"
Thanx George
First google link: Get Registered File Types and Their Associated Icons in C#[^]
Proud to have finally moved to the A-Ark. Which one are you in? Developer, Author (Guardians of Xen)
-
Does anyone know if there is a way of getting the default image of a file to show in a file browser. ie .txt image will be notepad etc. Is there a way of finding this from "System.io.DirectoryInfo" or is there some other way i could retrieve this name. I can then display the correct type of image for the file in my browser )
UI.Entry(Image.FromFile("FolderFull_125x125.png"
Thanx George
-
hi, try to extract the icon from the file with
System.Drawing.Icon.ExtractAssociatedIcon("log.txt").ToBitmap()
you can save the image to file with bitmap.Save("log.txt.png").. hope i could help :)
I don't think so, the OP wants the icon associated with a file, not an icon from within the file. :)
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
-
hi, try to extract the icon from the file with
System.Drawing.Icon.ExtractAssociatedIcon("log.txt").ToBitmap()
you can save the image to file with bitmap.Save("log.txt.png").. hope i could help :)
-
Does anyone know if there is a way of getting the default image of a file to show in a file browser. ie .txt image will be notepad etc. Is there a way of finding this from "System.io.DirectoryInfo" or is there some other way i could retrieve this name. I can then display the correct type of image for the file in my browser )
UI.Entry(Image.FromFile("FolderFull_125x125.png"
Thanx George
http://www.codeproject.com/KB/cs/GetFileTypeAndIcon.aspx[^]
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”