Can I get the icon associated with an installed printer through .Net?

前端 未结 2 1354
花落未央
花落未央 2020-12-06 19:25

I know how to get the list of all of the installed printers on a machine with .Net:

foreach (String printer in PrinterSettings.InstalledPrinters)
{        
          


        
2条回答
  •  既然无缘
    2020-12-06 20:26

    The icon is normally embedded into either one of the dll files or the main EXE, look at the System.Drawing.Icon static methods, the link below is for WinForms, its slightly different with WPF as you have to create an ImageSource from the extracted icon stream.

    How to: Extract the Icon Associated with a File in Windows Forms

提交回复
热议问题