[英]Serialize/Deserialize System.Drawing.Color with System.Text.Json
問題是使用System.Drawing.Color和System.Text.Json使用Color序列化/反序列化一個類。 public class Test { public Color Farbe { get; set; } public IEnumerable<Color ...
[英]Serialize/Deserialize System.Drawing.Color with System.Text.Json
問題是使用System.Drawing.Color和System.Text.Json使用Color序列化/反序列化一個類。 public class Test { public Color Farbe { get; set; } public IEnumerable<Color ...
[英]How to find base color by hex color value in C#
給定一個十六進制顏色代碼,如何將顏色分類為是否屬於 C# 中的紅色/綠色/黃色/粉紅色/橙色/藍色? ...
[英]Is there a Visual Studio Extension that shows the colors of System.Drawing.Color in the dropdown
我發現自己經常查看System.Drawing.Color 的 Microsoft 文檔以查看我從哪個 Enum 獲得的顏色,所以我想知道是否有一個擴展可以在字符串旁邊顯示一個帶有顏色的小框價值觀(我用我出色的繪畫技巧做到了這一點): 我在擴展市場上發現了大量顯示 CSS 或 XAML 中顏色的擴 ...
[英]Error CS7069 Reference to type 'Image' claims it is defined in 'System.Drawing', but it could not be found
我遇到了 System.Drawing 在 UWP 應用程序中不起作用的原始問題。 經過短暫的網絡搜索 ImageProcessor ( https://imageprocessor.org/imageprocessor/#about ) 出現了。 我現在的情況是: 我正在嘗試將白色圖像更改為某種 ...
[英]How to convert System.Drawing.Color to ClosedXML.Excel.XLColor in C#
我正在使用ClosedXML並且可以像下面的代碼一樣設置特定單元格的背景顏色。 我的問題是: 是否有適當的方法將 System.Drawing.Color 轉換為 ClosedXML.Excel.XLColor? 歡迎任何意見或建議。 ...
[英]The base System.Drawing.Color class returning only one color after a number of iterations
免責聲明:我可能包含了太多信息,所以不要被包含的信息量嚇到。 我想為 c# 控制台應用程序制作一個帶有圖形的簡單 2D 游戲。 為了了解我將如何處理圖形的基礎知識,我做了一個小項目,在其中我正在使用基本顏色 class(和庫 Colourful.Console,更多信息請訪問: http://col ...
[英]Devexpress webchartcontrol how to get unlimited colors collection and store in list array
目前我有 204 個項目在 webchartcontrol 中顯示為圖例,我當前的代碼只能支持大約 150 個項目的顏色。 如果超過,則錯誤“索引超出范圍。必須為非負數且小於集合的大小。參數名稱:索引”。 如何獲得無限顏色以存儲在列表數組中? 請指導我。 我的代碼 ...
[英]C# Casting object to System.Drawing.Color
我正在嘗試將從注冊表項讀取的顏色設置轉換為System.Drawing.Color。 根據本文,我正在將從注冊表返回的對象轉換為System.Drawing.Color : 將OBJECT轉換為System.Drawing.Color 以下是我作為對象獲取的這些注冊表值的幾個示例: ...
[英]System.Drawing.Color ToKnownName
我需要一個與System.Drawing.Color.FromKnownName相反的函數,該函數將System.Drawing.Color.Red轉換為“ Red”或“ red”。 提供示例代碼: ...
[英]Getting the color object from ColorDialog.color.name
在我的winforms應用程序中,我有一個ColorDialog控件,當用戶選擇一種顏色時,我將保存顏色對象的名稱。 對於自定義顏色值,以FF開頭:fffdfcc8(這是淺黃色/乳白色) 稍后,我想從顏色名稱字符串fffdfcc8到system.drawing.color對象訪問顏色對象 ...
[英]How can I assign a color to a font in EPPlus?
我可以像這樣設置單元格或單元格范圍的背景顏色: 但是,我無法設置字體顏色。 我試過這個: ...編譯失敗有兩個錯誤消息:第一個,我無法將 System.Drawing.Color 分配給 OfficeOpenXml.Style.ExcelColor,第二個屬性無論如何都是只讀的。 只是為 ...
[英]How to convert from System.Drawing.Color to Excel.ColorFormat in C#? Change comment color
我正在為 Excel 開發 vsto 插件,我正在嘗試將顏色更改為 Excel 中的注釋。 這是我擁有的代碼: 我得到的例外是: 無法將類型“System.Drawing.Color”隱式轉換為“Microsoft.Office.Interop.Excel.ColorFormat” ...
[英]Best practices for returning a Color.FromArgb when given an int that may be null C#
我只是很好奇,根據目前的情況,最佳實踐解決方案是什么。 我有一個以ARGB整數形式存儲顏色的數據庫,但是我允許它為可空值,因為有時可能不需要指定顏色。 使用實體框架,我生成了一個帶有ColorArgb屬性的類,用於訪問按預期返回和int的列。 我還手動添加了另一個屬性Color,該屬性返回 ...
[英]How can I convert system.drawing.color back to a string?
我在Visual Basic中的這段代碼運行良好,可以將從ComboBox.text中選擇的顏色保存到My.Settings中,該顏色設置為system.drawing.color。 我無法從My.Settings中保存的顏色轉換回ComboBox.text顏色。 我實際上找到了 ...
[英]How to determine if a color is close to another color
我正在創建一種顏色工具,這個工具應該告訴我顏色是否接近另一種顏色,例如: ColorsAreClose()函數應該如何看? ...
[英]Using C# to set System.Drawing.Color.FromName
目標:目標是根據數據表中的文本值動態設置System.Drawing.Color。 文本值是System.Drawing.Color中顏色的名稱。 目的是根據給定值更改網格的背景顏色。 問題:我現在使用的方法沒有從數據表中獲取值並將Color設置為0,0,0,0。 使用ViewSta ...
[英]Why does the color after Image.Clear(x) not exactly equal the color x?
此問題的示例代碼在很大程度上是不言自明的,因此: 在這種情況下,我希望背景的顏色與清除后的顏色相同。 相反,我得到這個: 這怎么可能? 通過: 其他一些失敗的例子: ...
[英]How to use System.Drawing.Color?
我昨天遇到了問題。 我想在Android和iOS項目中使用System.Drawing.Color結構。 Xamarin文檔聲稱MonoTouch框架具有System.Drawing.Color結構(鏈接 - http://iosapi.xamarin.com/?link=T:System. ...
[英]Color the background of a form depending on radio button
我一直在努力讓表單根據用戶選擇的選項立即更改背景顏色。 他可以在紅色,綠色和藍色之間進行選擇。 我試圖使用system.drawing.color,但似乎無法更改表格的顏色。 應該使用委托。 我只是在學習無模式對話框。 請幫助... 到目前為止,這是我所做的: ...
[英]Passing FromArgb() as a parameter to a function
我有以下功能: 我可以這樣稱呼它: 沒有任何問題。 我希望能夠這樣調用該函數: 為了使單元格的顏色選擇更加精細,但是當我這樣做時,出現以下錯誤: 我試過像這樣調用函數: "FromArgb(217,217,217)" 'FromArgb(21 ...