从Java到C#的int rosu = Color.red.getRGB() [英] int rosu=Color.red.getRGB() from Java to C#

查看:115
本文介绍了从Java到C#的int rosu = Color.red.getRGB()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在手动将代码从Java转换为C#,但我不知道如何转换

I am converting by hand a code from Java to C#, and I don''t know how to convert

private static int rosu = Color.Red.getRGB;



我收到此错误:



I get this error:

''System.Drawing.Color'' does not contain a definition for ''getRGB'' and no extension method ''getRGB'' accepting a first argument of type ''System.Drawing.Color'' could be found (are you missing a using directive or an assembly reference?)



我在这种情况下使用声明的"rosu":



I use the declared "rosu" in this context:

for (uy=0;uy<h;uy++)
     for (ux=0;ux<w;ux++)
         if(curba[uy][ux]==255)
               curba[uy][ux]=rosu;



谢谢



Thank you

推荐答案

错误告诉您没有与您使用的功能相匹配的功能.请尝试以下功能:Color.Red.ToArgb()
The error is telling you that there is no function that matches the one you told it to use. Try this function instead: Color.Red.ToArgb()


这篇关于从Java到C#的int rosu = Color.red.getRGB()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆