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
804
adding Image in codeBehind
posted

I want to put Image in code behind with the PATH of the image

Do you have something like:

imageViewer1.items.add(Path of the image);

 

thanks you

Gabriel Deschênes

  • 4493
    Suggested Answer
    posted

    Hello Gabriel,

    You can use this (shortest) statement:

    this.ImageViewer.Items.Add(new ImageItem(path_of_image, alt_for_image, tooltip_for_image))

    Where, of course, you can leave a string.Empty, or just "" for ALT and ToolTip parameters.

    Thus you can add ImageItem objects to the Items Collection. And For complete dcumentation on different contructors of ImageItem you can visit online help.