I have trouble understanding the differences between the Image class and the Bitmap class. Now, I know that the Bitmap inherits from the Image but from what I understand both are very similar. Can anyone shed some light on this please?
I have trouble understanding the differences between the Image class and the Bitmap class. Now, I know that the Bitmap inherits from the Image but from what I understand both are very similar. Can anyone shed some light on this please?
The Bitmap class is an implementation of the Image class. The Image class is an abstract class;
The Bitmap class contains 12 constructors that construct the Bitmap object from different parameters. It can construct the Bitmap from another bitmap, and the string address of the image.
See more in this comprehensive sample.
Image provides an abstract access to an arbitrary image , it defines a set of methods that can loggically be applied upon any implementation of Image. Its not bounded to any particular image format or implementation . Bitmap is a specific implementation to the image abstract class which encapsulate windows GDI bitmap object. Bitmap is just a specific implementation to the Image abstract class which relay on the GDI bitmap Object.
You could for example , Create your own implementation to the Image abstract , by inheriting from the Image class and implementing the abstract methods.
Anyway , this is just a simple basic use of OOP , it shouldn't be hard to catch.