C#で以下のようなエラーが出るのですが対象方法をおしえてください。
Posted: 2017年5月11日(木) 11:14
お世話になります。
C#を勉強中なのですがビルド後実行すると以下のようなエラーが出力されてしまいます。
エラーの内容
System.InvalidCastException: '型 'System.Drawing.Color' のオブジェクトを型 'System.IConvertible' にキャストできません。'
---処理(C#)---
MapWinGIS.Shapefile sf;
色々な処理
sf.Labels.FontColor =
Color.FromArgb(Convert.ToInt32(Color.Red.R),Convert.ToInt32(Color.Red.G),Convert.ToInt32(Color.Red.B)));
---END---
この処理はサンプルに記述されていてVB.NETでもC#でも動作すると記述があります。
VBではエラーは出力されず動作は終了します。
----処理(VB)---
Dim sf As MapWinGIS.Shapefile
色々な処理
sf.Labels.FontColor =
Convert.ToUInt32(RGB(Convert.ToInt32(Color.Red.R),Convert.ToInt32(Color.Red.G),Convert.ToInt32(Color.Red.B)))
---END---
何か解決策をご存じの方ご教示いただけないでしょうか?
以上、宜しくお願い申し上げます。
C#を勉強中なのですがビルド後実行すると以下のようなエラーが出力されてしまいます。
エラーの内容
System.InvalidCastException: '型 'System.Drawing.Color' のオブジェクトを型 'System.IConvertible' にキャストできません。'
---処理(C#)---
MapWinGIS.Shapefile sf;
色々な処理
sf.Labels.FontColor =
Color.FromArgb(Convert.ToInt32(Color.Red.R),Convert.ToInt32(Color.Red.G),Convert.ToInt32(Color.Red.B)));
---END---
この処理はサンプルに記述されていてVB.NETでもC#でも動作すると記述があります。
VBではエラーは出力されず動作は終了します。
----処理(VB)---
Dim sf As MapWinGIS.Shapefile
色々な処理
sf.Labels.FontColor =
Convert.ToUInt32(RGB(Convert.ToInt32(Color.Red.R),Convert.ToInt32(Color.Red.G),Convert.ToInt32(Color.Red.B)))
---END---
何か解決策をご存じの方ご教示いただけないでしょうか?
以上、宜しくお願い申し上げます。