visual studio 2010 - What assembly reference should I add in order to be able to create an instance of the Image-class (C#, WPF)? -


i have created class library containing several classes. assembly reference should add in order able create instance of image-class? wpf-application created in visual studio 2010 using c#.

my code follows if interested.

thanks in advance! anders branderud

    /// <summary>     /// create image image address , return it.     /// </summary>     /// <param name="imageaddress">name of image file without jpg ending.</param>     /// <returns></returns>     ///<remarks>adapted code microsoft-website</remarks>     public static bitmapimage createanddisplayimage(string imageaddress)     {         // create image element         image myimage = new image();         myimage.width = 200;          // create source         bitmapimage mybitmapimage = new bitmapimage();            mybitmapimage.begininit();         //image address         uri relativeuri = new uri(image_directory + imageaddress + ".jpg", urikind.relative);         mybitmapimage.urisource = relativeuri;            // image_directory + "/"         // save significant application memory, set decodepixelwidth or           // decodepixelheight of bitmapimage value of image source desired          // height or width of rendered image. if don't this, application          // cache image though rendered normal size rather          // size displayed.         // note: in order preserve aspect ratio, set decodepixelwidth         // or decodepixelheight not both.         mybitmapimage.decodepixelwidth = 200;         mybitmapimage.endinit();         //set image source         return mybitmapimage; 

}

image (as in system.drawing.image) abstract. use bitmap (system.drawing.bitmap) derives instead. unless, whatever reason, you're doing own implementation of bitmap.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -