| | |
Converting Java to C# GDI problem
Please support our C# advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Mar 2009
Posts: 5
Reputation:
Solved Threads: 0
Ok I'm converting a program from Java to C# and currently stuck on a certain aspect of it.
Ok I have;
pbMand is the name of my picture box, which I will use to display the image (not drawing directly to form, using PB).
Then further on I have...
I can't find an equivilent form javas setColor to something in C#...It seems to lack anything colour related in g1's methods.
And the error it gives is...
Error 1 'System.Drawing.Graphics' does not contain a definition for 'setColor' and no extension method 'setColor' accepting a first argument of type 'System.Drawing.Graphics' could be found (are you missing a using directive or an assembly reference?
Any help to solve this issue would be appreciated. I'm not sure what other information I can give either, so feel free to ask questions
Ok I have;
Java Syntax (Toggle Plain Text)
private Graphics g1; private Bitmap picture; picture = new Bitmap(x1, y1); g1 = Graphics.FromImage(picture); pbMand.Image = picture;
pbMand is the name of my picture box, which I will use to display the image (not drawing directly to form, using PB).
Then further on I have...
java Syntax (Toggle Plain Text)
g1.setColor(Color.FromArgb(Convert.ToInt16(h), Convert.ToInt16(0.8f), Convert.ToInt16(b))); //djm test Color col = Color.getHSBColor(h, 0.8f, b);
I can't find an equivilent form javas setColor to something in C#...It seems to lack anything colour related in g1's methods.
And the error it gives is...
Error 1 'System.Drawing.Graphics' does not contain a definition for 'setColor' and no extension method 'setColor' accepting a first argument of type 'System.Drawing.Graphics' could be found (are you missing a using directive or an assembly reference?
Any help to solve this issue would be appreciated. I'm not sure what other information I can give either, so feel free to ask questions
Last edited by peter_budo; Nov 2nd, 2009 at 7:31 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
![]() |
Other Threads in the C# Forum
- Previous Thread: help !!!!!!!
- Next Thread: sqlException--invalid expression
Views: 426 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for bitmap, gdi+







