Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
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?)


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
Posted

1 solution

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()
 
Share this answer
 
Comments
bosco_boom 22-Jan-11 23:38pm    
I tried that and now I get this error: Cannot convert method group 'ToArgb' to non-delegate type 'int'. Did you intend to invoke the method?
JOAT-MON 22-Jan-11 23:53pm    
Odd...try giving it a fully qualified name: System.Drawing.Color.Red.ToArgb()
bosco_boom 22-Jan-11 23:51pm    
forgot the parentheses...:D...thank you
JOAT-MON 22-Jan-11 23:53pm    
Good deal! :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900