Click here to Skip to main content
15,895,709 members
Articles / Programming Languages / C#

Find File in Solution

Rate me:
Please Sign up or sign in to vote.
5.00/5 (23 votes)
28 Mar 2010CPOL6 min read 112.5K   3K   48  
Find any file in solution using incremental search and advanced filtering

namespace SlnFileFindAddIn
{
    sealed class ConvertImage : System.Windows.Forms.AxHost
    {
        private ConvertImage()
            : base(null)
        {
        }

        public static stdole.IPictureDisp Convert
            (System.Drawing.Image image)
        {
            return (stdole.IPictureDisp)System.Windows.Forms.
                AxHost.GetIPictureDispFromPicture(image);
        }

        public static System.Drawing.Image Convert(stdole.IPictureDisp image)
        {
            if (image.Type == 1)
            {
                System.IntPtr hPal = (System.IntPtr)image.hPal;
                return System.Drawing.Image.FromHbitmap(
                    (System.IntPtr)image.Handle, hPal);
            }

            return null;
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Australia Australia
More than ten years of C++ native development, and counting.

Smile | :)

Comments and Discussions