Create Extension Methods in C# and use same Extension Method in object of different types

If we want to add our own method to any type, we generally drive another type from this and add our method. This is one way but is not good if we only want to add one method which is not going to use private properties of our type object.

Another option could be to add Extension Method to any type. This way you can add your method to any type and it will be accessible in the type object you have created. Keep on reading

Resize image with transparent background maintaining transparency

Today I faced a problem when I was resizing image in one of my project. Actually he problem was that I was using image resize code from one of my old project which were working fine earlier but not today. It is making my image background dark black which I obviously don’t need.

Reason for that code not working today is that earlier I always used jpg images for resizing and for that my old code was fine. Today when I tested same code with transparent background png file it gave me that awkward result. Keep on reading