Click here to Skip to main content
16,011,374 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys,

As a personal project I'm creating a system which visualizes a paint robot. I have a Paint Robot class with the required member variables and behaviour. I would also to associate an image with the robot which can be used in basic animation, for example 'green' active & 'red' fault etc. Does anyone know the best way to create image? Do I have to draw it within my development environment or can I draw it using an external editor and import it into my project?

Thanks guys
Posted
Comments
Tomas Takac 8-Nov-14 3:42am    
You can draw it in external editor and include in your project as a resource.

Either: I prefer to draw images outside VS (because I find the VS image creation tools extremely...um...basic) and import them.

Exactly how you would paint the image in your app will depend on you, and what your Robot Class is derived from.

See here: http://msdn.microsoft.com/en-us/library/vstudio/bbwz4bhx(v=vs.100).aspx[^]
 
Share this answer
 
Usually there are many methods of creating an image. In .NET you can use a Bitmap to create an image on the run-time too. So it is not a problem creating the images in .NET, on the run-time too.

If you're using Windows Forms, then use System.Drawing.Bitmap[^], or if you're using the WPF application, use the System.Windows.Media.Imaging.BitmapImage[^]

But a better way would be since you're going to have a defined image (either green or red, or any other particular color) in your application, then create a simple either R, G, B image and add it to your project and use it along with your class.

One more thing, you can add this Image field to your Robot class too. Like this,

C#
public class Robot {
   // other properties, you can set it as a private one too
   public Image RobotImage { get; set; }

   // program logic and methods
}


Now each time you will create a Robot (object) you will be able to set the Image it would have for itself. This way, you won't need to do any other coding, it will be set as a property for the Robot.
 
Share this answer
 
Comments
conradsmith 8-Nov-14 5:08am    
Thanks for your input guys it's very much appreciated. I found an article on here by Dario Solera on WPF 3D which is very good. I'm currently working through his example. Seems quite a complicated subject though, further study may be necessary

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