0

I tried this answer

and I think it's correct because if I enter here a non existing file like this Properties.Resources.ddd it gives me the error of Project.Properties.Resource does not contain a definition for ddd and when I put the correct filename which is logo. It gives me errors like this. I will also publish this so I really need that image to be included.

The best overloaded method match for 'System.IO.FileStream.FileStream(string, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare)' has some invalid arguments Argument 1: cannot convert from 'System.Drawing.Bitmap' to 'string'

What seems to be the error that it won't accept my resource? It's a png file EDIT:
I'm using an iTextSharp. This is my first lines of the program

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using iTextSharp.text;
using iTextSharp.text.pdf;

My initial code is this

Stream inputImg = new FileStream(@"C:\Users\Company\Downloads\logo.png", FileMode.Open, FileAccess.Read, FileShare.Read);

But I'm also installing this to other computer as well.

Community
  • 1
  • 1
Fiendcoder1
  • 119
  • 1
  • 1
  • 12
  • Have you looked at [How to create and use resources in .NET](http://stackoverflow.com/questions/90697/how-to-create-and-use-resources-in-net) OR [How to: Add or Remove Resources](https://msdn.microsoft.com/en-us/library/3bka19x4(v=vs.100).aspx) – JohnG Dec 09 '16 at 01:36
  • Yes, although they may seem to be a little different but I successfully added a resource. I'm using also an iTextSharp. let me edit my question – Fiendcoder1 Dec 09 '16 at 01:41
  • I am not familiar with iTextSharp so you may want to add a tag for the platform you are using. But there are two things here. One you can open a file like your logo, OR you can embed a file like your logo in the project. The difference being that when you simply open a file, the file must be on the target machine. If you "embed" the file into your project then it will be added to the project file and will be complied into the executable. It is not clear which you want to do. I hope this makes sense. – JohnG Dec 09 '16 at 01:47
  • I'm sorry, I added some information. – Fiendcoder1 Dec 09 '16 at 01:50

0 Answers0