Click here to Skip to main content
15,884,353 members
Home / Discussions / C#
   

C#

 
GeneralRe: Fuzzy Icons Pin
Richard Andrew x649-Sep-20 21:52
professionalRichard Andrew x649-Sep-20 21:52 
GeneralRe: Fuzzy Icons Pin
Richard MacCutchan9-Sep-20 22:23
mveRichard MacCutchan9-Sep-20 22:23 
GeneralRe: Fuzzy Icons Pin
Richard Andrew x649-Sep-20 22:25
professionalRichard Andrew x649-Sep-20 22:25 
AnswerRe: Fuzzy Icons Pin
Gerry Schmitz10-Sep-20 8:22
mveGerry Schmitz10-Sep-20 8:22 
GeneralRe: Fuzzy Icons Pin
Richard Andrew x6410-Sep-20 8:50
professionalRichard Andrew x6410-Sep-20 8:50 
GeneralRe: Fuzzy Icons Pin
Gerry Schmitz10-Sep-20 9:24
mveGerry Schmitz10-Sep-20 9:24 
GeneralRe: Fuzzy Icons Pin
Richard Andrew x6410-Sep-20 10:48
professionalRichard Andrew x6410-Sep-20 10:48 
AnswerRe: Fuzzy Icons Pin
mo149212-Sep-20 12:49
mo149212-Sep-20 12:49 
Without seeing any code I don't know if this will help. I fixed this problem in VB by converting the icon to a bitmap with the routine below. I also use ExtractIconEx. I found that icon.ToBitmap() loses resolution for some reason. Sorry, you'll have to convert to C#.

''' <summary>
''' Convert Icon to Bitmap with resizing.
''' </summary>
''' <param name="ic"></param>
''' <param name="sz"></param>
''' <returns></returns>
''' <remarks></remarks>
Public Shared Function IconToBitmap(ByVal ic As Icon, ByVal sz As Size) As Bitmap
If ic Is Nothing Then Return Nothing

Dim sourceWidth As Integer = ic.Width
Dim sourceHeight As Integer = ic.Height

Dim dPercent As Double = 0
Dim dPercentW As Double = 0
Dim dPercentH As Double = 0

dPercentW = (sz.Width / sourceWidth)
dPercentH = (sz.Height / sourceHeight)

If (dPercentH < dPercentW) Then
dPercent = dPercentH
Else
dPercent = dPercentW
End If

Dim destWidth As Integer = (sourceWidth * dPercent)
Dim destHeight As Integer = (sourceHeight * dPercent)

Dim bm As Bitmap = New Bitmap(destWidth, destHeight, PixelFormat.Format32bppArgb)
bm.SetResolution(destWidth, destHeight)

Dim g As Graphics = Graphics.FromImage(bm)
'g.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic
' This gives the best quality
g.InterpolationMode = Drawing2D.InterpolationMode.NearestNeighbor
g.DrawIcon(ic, New Rectangle(0, 0, destWidth, destHeight))
g.Dispose()

Return bm
End Function
GeneralRe: Fuzzy Icons Pin
Richard Andrew x6412-Sep-20 13:28
professionalRichard Andrew x6412-Sep-20 13:28 
QuestionHow to dynamically load assembly and dependencies from file path. Pin
koirat8-Sep-20 5:26
koirat8-Sep-20 5:26 
AnswerRe: How to dynamically load assembly and dependencies from file path. Pin
Richard Andrew x648-Sep-20 5:37
professionalRichard Andrew x648-Sep-20 5:37 
GeneralRe: How to dynamically load assembly and dependencies from file path. Pin
koirat8-Sep-20 6:36
koirat8-Sep-20 6:36 
AnswerRe: How to dynamically load assembly and dependencies from file path. Pin
Gerry Schmitz8-Sep-20 7:12
mveGerry Schmitz8-Sep-20 7:12 
GeneralRe: How to dynamically load assembly and dependencies from file path. Pin
koirat8-Sep-20 8:57
koirat8-Sep-20 8:57 
GeneralRe: How to dynamically load assembly and dependencies from file path. Pin
Gerry Schmitz8-Sep-20 10:34
mveGerry Schmitz8-Sep-20 10:34 
AnswerRe: How to dynamically load assembly and dependencies from file path. Pin
Eddy Vluggen8-Sep-20 7:41
professionalEddy Vluggen8-Sep-20 7:41 
GeneralRe: How to dynamically load assembly and dependencies from file path. Pin
koirat8-Sep-20 9:59
koirat8-Sep-20 9:59 
GeneralRe: How to dynamically load assembly and dependencies from file path. Pin
Eddy Vluggen8-Sep-20 10:04
professionalEddy Vluggen8-Sep-20 10:04 
GeneralRe: How to dynamically load assembly and dependencies from file path. Pin
koirat8-Sep-20 12:25
koirat8-Sep-20 12:25 
QuestionCreate a Multi-Layer Data Model from a MySQL Query Pin
mjeeves7-Sep-20 8:25
mjeeves7-Sep-20 8:25 
AnswerRe: Create a Multi-Layer Data Model from a MySQL Query Pin
mjeeves7-Sep-20 8:43
mjeeves7-Sep-20 8:43 
GeneralRe: Create a Multi-Layer Data Model from a MySQL Query Pin
Richard MacCutchan7-Sep-20 9:27
mveRichard MacCutchan7-Sep-20 9:27 
GeneralRe: Create a Multi-Layer Data Model from a MySQL Query Pin
mjeeves7-Sep-20 9:44
mjeeves7-Sep-20 9:44 
GeneralRe: Create a Multi-Layer Data Model from a MySQL Query Pin
Richard Deeming7-Sep-20 22:34
mveRichard Deeming7-Sep-20 22:34 
QuestionProblem showing a symbol from a custom font Pin
Mc_Topaz6-Sep-20 21:18
Mc_Topaz6-Sep-20 21:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.