Avatar of mathieu_cupryk
mathieu_cupryk
Flag for Canada

asked on 

Need to paste a bitmap using inches.

I have the following:
string DirectoryName = Directory.GetCurrentDirectory();
            string AppPath = Application.StartupPath.ToString();
            Bitmap CWBLogo = (Bitmap) System.Drawing.Image.FromFile(AppPath + "\\..\\..\\Images\\CWB.bmp", false);
        //    Sheets("pivot").OLEObjects("CWBLogo").Object.Picture = LoadPicture(AppPath + "\\..\\..\\Images\\CWB.bmp");

            //using (CWBLogo)
            //{
            //     width = CWBLogo.Width * 72.0 / 96.0;
            //     height = CWBLogo.Height * 72.0 / 96.0;
            //}

            Excel.Range rangeimg = excelWorkSheet.get_Range("B2", "D4");
            Clipboard.SetDataObject(CWBLogo);
            rangeimg.Select();
            excelWorkSheet.Paste(Type.Missing, Type.Missing);

I need to make sure I can put this in inches.
C#Microsoft Excel.NET Programming

Avatar of undefined
Last Comment
Chris Bottomley

8/22/2022 - Mon