Click here to Skip to main content
14,738,219 members
Home » Discussions » C#
   

C#

 
GeneralRe: Fuzzy Icons Pin
Richard Andrew x649-Sep-20 22:52
professionalRichard Andrew x649-Sep-20 22:52 
GeneralRe: Fuzzy Icons Pin
Richard MacCutchan9-Sep-20 23:23
mveRichard MacCutchan9-Sep-20 23:23 
GeneralRe: Fuzzy Icons Pin
Richard Andrew x649-Sep-20 23:25
professionalRichard Andrew x649-Sep-20 23:25 
AnswerRe: Fuzzy Icons Pin
Gerry Schmitz10-Sep-20 9:22
mveGerry Schmitz10-Sep-20 9:22 
GeneralRe: Fuzzy Icons Pin
Richard Andrew x6410-Sep-20 9:50
professionalRichard Andrew x6410-Sep-20 9:50 
GeneralRe: Fuzzy Icons Pin
Gerry Schmitz10-Sep-20 10:24
mveGerry Schmitz10-Sep-20 10:24 
GeneralRe: Fuzzy Icons Pin
Richard Andrew x6410-Sep-20 11:48
professionalRichard Andrew x6410-Sep-20 11:48 
AnswerRe: Fuzzy Icons Pin
mo149212-Sep-20 13:49
Membermo149212-Sep-20 13: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 14:28
professionalRichard Andrew x6412-Sep-20 14:28 
QuestionHow to dynamically load assembly and dependencies from file path. Pin
koirat8-Sep-20 6:26
Memberkoirat8-Sep-20 6:26 
AnswerRe: How to dynamically load assembly and dependencies from file path. Pin
Richard Andrew x648-Sep-20 6:37
professionalRichard Andrew x648-Sep-20 6:37 
GeneralRe: How to dynamically load assembly and dependencies from file path. Pin
koirat8-Sep-20 7:36
Memberkoirat8-Sep-20 7:36 
AnswerRe: How to dynamically load assembly and dependencies from file path. Pin
Gerry Schmitz8-Sep-20 8:12
mveGerry Schmitz8-Sep-20 8:12 
GeneralRe: How to dynamically load assembly and dependencies from file path. Pin
koirat8-Sep-20 9:57
Memberkoirat8-Sep-20 9:57 
GeneralRe: How to dynamically load assembly and dependencies from file path. Pin
Gerry Schmitz8-Sep-20 11:34
mveGerry Schmitz8-Sep-20 11:34 
AnswerRe: How to dynamically load assembly and dependencies from file path. Pin
Eddy Vluggen8-Sep-20 8:41
professionalEddy Vluggen8-Sep-20 8:41 
GeneralRe: How to dynamically load assembly and dependencies from file path. Pin
koirat8-Sep-20 10:59
Memberkoirat8-Sep-20 10:59 
GeneralRe: How to dynamically load assembly and dependencies from file path. Pin
Eddy Vluggen8-Sep-20 11:04
professionalEddy Vluggen8-Sep-20 11:04 
GeneralRe: How to dynamically load assembly and dependencies from file path. Pin
koirat8-Sep-20 13:25
Memberkoirat8-Sep-20 13:25 
QuestionCreate a Multi-Layer Data Model from a MySQL Query Pin
mjeeves7-Sep-20 9:25
Membermjeeves7-Sep-20 9:25 
AnswerRe: Create a Multi-Layer Data Model from a MySQL Query Pin
mjeeves7-Sep-20 9:43
Membermjeeves7-Sep-20 9:43 
GeneralRe: Create a Multi-Layer Data Model from a MySQL Query Pin
Richard MacCutchan7-Sep-20 10:27
mveRichard MacCutchan7-Sep-20 10:27 
GeneralRe: Create a Multi-Layer Data Model from a MySQL Query Pin
mjeeves7-Sep-20 10:44
Membermjeeves7-Sep-20 10:44 
GeneralRe: Create a Multi-Layer Data Model from a MySQL Query Pin
Richard Deeming7-Sep-20 23:34
mveRichard Deeming7-Sep-20 23:34 
QuestionProblem showing a symbol from a custom font Pin
Mc_Topaz6-Sep-20 22:18
MemberMc_Topaz6-Sep-20 22: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.