visual studio 2008 - inserting own image on excel through c# -


Hello I have the following code ... where I generate and paste my own image to Excel worksheet Can you tell me why its background color is always blue? Is it possible to change it somehow to make it transparent or white? (I tried the flag. MaccronPier (), but it also does not work)

  bitmap flag = new bitmap (200,200); (Graphics G = Graphics. Frame Image) {g.DrawString ("N", New Font ("Wordana", 80, Font Style), New Solidbrush (Color Black), New Point (40, 30)) ; } System.Windows.Forms.Clipboard.SetDataObject (flag, true); Ws.Paste (category, type messing);  

When I use the following

  flag.Save ("C: \\ image.png", System.Drawing.Imaging.ImageFormat. Png); 

The text "itemprop =" text ">

I know this is the answer to an old post, but if someone else found it on Google (like I did):

BMP does not have background information, so it needs to be changed:

memorystream MS = new memorystream (); Bmp.Save (ms, ImageFormat.Png); IDataObject Data Object = New Data Object (); DataObject.SetData ("PNG", False, MS); System.Windows.Forms.Clipboard.SetDataObject (Data Object, Incorrect);

Copy the solution from this address Is given, where the complete solution is:


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -