Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
575
Scaling images
posted

 What are some ways I can work with images?  Especially scaling them.  Can you provide some sample code?

 

For example:

Infragistics.Documents.Report.IImage siteImageHeader = headerSite.AddImage(new Infragistics.Documents.Graphics.Image(ROOT_PATH + "docImages\\test4.jpg"), 100, 100);

 

if this image is too big, can I scale it, shrink it, or something?  If it is too small can I make it bigger?  I realize I may get defects or pixelation in the image by doing that...I won't worry about that.

 

==========================

PS:  I am surprised it's been a few days and no replies on my question below!  Usually this forum is spot-on with fast replies!  I guess I should be grateful for the help I get and not complain:

http://news.infragistics.com/forums/t/5267.aspx

Parents
  • 37774
    Verified Answer
    posted

    There is no built-in way to get an image to automatically scale, as far as I am aware.  What you can do is create a new Bitmap with the desired size in-memory and then pass that to the AddImage method, such as:

    Image source = Image.FromFile("test.bmp");
    Bitmap scaledImg = new Bitmap(source, new Size(900, 10));                       
    report.AddSection().AddImage(new Infragistics.Documents.Graphics.Image(scaledImg));

    Please remember that these forums area a peer-to-peer resource to share issues and ideas with other Infragistics users.  If you require official support from Infragistics for further assistance, please submit a support incident to Infragistics Developer Support from this page of our website.

Reply Children
No Data