Click here to Skip to main content
15,890,882 members
Home / Discussions / C#
   

C#

 
AnswerRe: Unique correspondence for characters Pin
OriginalGriff13-Sep-20 4:07
mveOriginalGriff13-Sep-20 4:07 
GeneralRe: Unique correspondence for characters Pin
keeponfalling1213-Sep-20 4:22
keeponfalling1213-Sep-20 4:22 
GeneralRe: Unique correspondence for characters Pin
OriginalGriff13-Sep-20 4:54
mveOriginalGriff13-Sep-20 4:54 
AnswerRe: Unique correspondence for characters Pin
trønderen13-Sep-20 4:33
trønderen13-Sep-20 4:33 
AnswerRe: Unique correspondence for characters Pin
Gerry Schmitz13-Sep-20 5:58
mveGerry Schmitz13-Sep-20 5:58 
GeneralRe: Unique correspondence for characters Pin
keeponfalling1214-Sep-20 4:05
keeponfalling1214-Sep-20 4:05 
QuestionHow to add Key and MergeField dynamically into WordProcessing document through C# program Pin
Ganapatisb10-Sep-20 22:30
Ganapatisb10-Sep-20 22:30 
SuggestionRe: How to add Key and MergeField dynamically into WordProcessing document through C# program Pin
Richard MacCutchan10-Sep-20 22:37
mveRichard MacCutchan10-Sep-20 22:37 
Rant[REPOST]: How to add Key and MergeField dynamically into WordProcessing document through C# program Pin
Richard Deeming10-Sep-20 22:49
mveRichard Deeming10-Sep-20 22:49 
QuestionRe: How to add Key and MergeField dynamically into WordProcessing document through C# program Pin
Eddy Vluggen12-Sep-20 16:02
professionalEddy Vluggen12-Sep-20 16:02 
QuestionFuzzy Icons Pin
Richard Andrew x649-Sep-20 15:38
professionalRichard Andrew x649-Sep-20 15:38 
AnswerRe: Fuzzy Icons Pin
Peter_in_27809-Sep-20 17:05
professionalPeter_in_27809-Sep-20 17:05 
GeneralRe: Fuzzy Icons Pin
Richard Andrew x649-Sep-20 20:40
professionalRichard Andrew x649-Sep-20 20:40 
GeneralRe: Fuzzy Icons Pin
Peter_in_27809-Sep-20 20:46
professionalPeter_in_27809-Sep-20 20:46 
GeneralRe: Fuzzy Icons Pin
Richard Andrew x649-Sep-20 21:02
professionalRichard Andrew x649-Sep-20 21:02 
AnswerRe: Fuzzy Icons Pin
Richard MacCutchan9-Sep-20 21:46
mveRichard MacCutchan9-Sep-20 21:46 
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 

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.