LayoutFarm.DemoBitmap.CreateFromGdiPlusBitmap C# (CSharp) Method

CreateFromGdiPlusBitmap() public static method

public static CreateFromGdiPlusBitmap ( System bmp ) : DemoBitmap
bmp System
return DemoBitmap
        public static DemoBitmap CreateFromGdiPlusBitmap(System.Drawing.Bitmap bmp)
        {
            return new DemoBitmap(bmp.Width, bmp.Height, bmp);
        }
    }

Usage Example

Esempio n. 1
0
        void contentMx_ImageLoadingRequest(object sender, LayoutFarm.ContentManagers.ImageRequestEventArgs e)
        {
            //load resource -- sync or async?
            string absolutePath = documentRootPath + "\\" + e.ImagSource;

            if (!System.IO.File.Exists(absolutePath))
            {
                return;
            }
            //load
            System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(absolutePath);
            e.SetResultImage(DemoBitmap.CreateFromGdiPlusBitmap(bmp));
        }