how to disable copying a picture from excel - c#

I have sucessfully inserted image to excel sheet.Now i should not allow the picture to be copied by anyone. how can i achieve this?
any idea.
thanks in advance.

You can't.
Of course, there are certain measures you could employ, but there are always ways around them. You could (somehow) disable copy & paste within Excel, but then the user could take a screenshot (Alt-PrtScn) and crop it in an image editor.
If you somehow disable the ability to take a screenshot, they may feed the monitor output of their machine to another machine with a screen grabber, and get the image that way.
Or, of course, accepting the loss of quality, they could point a camera at their screen and get it that way.

If your excel file is accessible by anyone, then you can't.
You can only shrink the images to low resolution or putting watermark on it.

Depending on your environment and audience (eg, an internal document in your company), Office IRM can prevent the document from being copied and even copied using print-screen.
Personally, I see these attempts as naive at best - the data can be easily copied anyway (for example by taking a photo of the screen), but it sends the right message to your colleagues.

Related

Can I open an image in Windows Photo Viewer without path to the image

I'm encrypting and decrypting images because they contain sensitive information.
My struggle here is that I cant do the standard Process.Start(saveImagePath); because the of the encryption.
So far my solution is to just make a Windows Form that opens it in PictureBox because it doesn't require a path and I can just do this:
newImage = enc.Decrypt();
pictureBox1.Image =newImage;
But it's been a struggle trying to simulate Windows Photo Viewer.
My question is, can I open an image with just the image newImage = enc.Decrypt(); without the path in Windows Photo Viewer (or any other similar software), or am I doomed to try and replicate a Photo Viewer program?
Let me start by saying that if the images information is highly sensitive, then there is no way to display it to the user and ensure its security 100%. Even with a memory stream, one can make a memory dump and access the sensitive info. That's not trivial, but doable.
Now that's out of the way, Windows processes cannot directly access each other's memory without going through privileged debug-like API functions like ReadProcessMemory. This is what keeps Windows stable and secure, but makes what you are trying to accomplish not doable. You have to use a file.
Others suggested saving the file in the Windows Temporary folder. That's not any more secure than saving it in any other folder like you're doing. A little more secure way is to create a RAM-Disk, save the files there, display them, and then remove the RAM-Disk.
The RAM-Disk is an in-memory simulation of a hard-disk and you can access it in the same way with a drive letter. Creating and then removing a RAM-Disk isn't a trivial task, and it only offers a little more security, but you're the only one who can decide whether it is worth it. The user can still see and access the files on the RAM-Disk, but only before it is removed. So the only added security it offers is reducing the window during which the user can directly access the files.
Opening the images in your own app like you're doing is still the most secure way, as the only way to extract those files is by making a memory dump, and that's really hard with images (it's easier with text). You can search for some library if you don't want to code it all by yourself.

Save image from camera (live image)

For my final project in school ( even though I'm not a programmer ) I have to make a program that reads barcodes. I have to use Common Vision Blox.
I got a live feedback from the camera and I'm able to snap it.
But I want to save this picture now, I tried using this method (Saving image to file), but there seems to be a fault. Probably because I don't actually know which reference to use. I'll add my program in pictures.
I would like to save the snap in JPEG or something, so that I call it further in the program to start the barcode recognition.
Hope you guys can help, thanks in advance!
The solution is actually quite simple: The object axCVimage1 has a method Save() and a method SaveImageByDialog(). Use whatever method suits your needs. For saving the current image to a jpg file, simply provide a file name that has the extension 'jpg'. If you need control over the compression ratio and quality, use the the method SaveLossyImage() instead.

Webclient image upload to server

This is a follow on from my last question (Here) as I don't think I gave enough information the first time around and i can't delete it.
I've got my image converted to a byte array but the follow on help and suggestions made it seem like that the image I wanted to save needed to first exist on my computer. Where, in fact, the image I want to take only exists in the picture box (its a screen grab). When I check my server to see if the image has been passed over, I don't see anything and nothing prompts me to name my image file or anything.
So my question is thus:
What is the best way for my to upload a screen grab from my application, using webclient, to my central server? Ideally the functionality I would like would be very similar to that of saving the image to my computer. The only difference is, it's not my hard drive I'm saving the image on. It's a server somewhere.

Mapping keystrokes to images in C#

I was hoping to get some guidance on a project that I'm not even sure can work. I want to write an application in C# that allows me to type with my keyboard, but what shows up on the screen is a specific image from an image bank. So, I'll have a few images stored, and I'd like to map each keystroke from my keyboard to a stored image. Is something like this possible?
If not, is it possible to write some sort of library that I can import into MS Word, which would do something similar for me?
I created a new font with http://fontstruct.com . It's pretty straight forward to use. Once you've made your font, you can download it as a true type font, and install it to your computer.
Thanks for the help!

Handle lots of images in C# application

I'm trying to create a card game in C# and for this I have alot of images that I need to load. They're all jpg images and there are about 7000 of them.
I would like to make sure that if you download the game, the images will not be easily accessible, meaning that they should not just be JPG images in a sub folder of the application. So I thought about imbedding them in a DLL file.
But how do I do this? And how do I handle this efficiently? Is there a tecnique to this sort of thing, or is another method preferable?
I would like to make sure that [...] the images will not be easily accessible
First, you should ask yourself why you want to forbid this. If you just want to avoid that someone else manipulates the pictures, you can leave them in a bunch of subfolders as JPGs, just generate checksums for each file and check them at the time the program loads the pictures.
If you want to avoid reuse of the pictures, you can leave them in a bunch of subfolders, but not as JPGs. Encode them with for example with the standard AES algorithm. But beware, that won't prevent anyone else of making screenshots while you application is running, so you should consider if that's really worth the effort.
EDIT: if you want to embed the images because installation gets easier when you have just one big file to deploy instead of 7000 single files, then you may write a helper program for creating resource files programmatically. See this page from Microsoft, especially the part about .resource files, to learn how to utilize the ResourceWriter class for that purpose.
If you have 7000 image, you need a database. Microsoft SQL Server Compact 4.0 is an option. It's small and easy to use.
I'm assuming that this is a windows application
In order to Embed a Image to the assembly
1. Right click the Image file and Select properties
2. In the Properties Pane Set the BuildAction as Embeded resource
So this Image becomes a embeded resource when the application is compiled
Then you can access the Image from the assembly like:
global::[[MyNameSpace]].Properties.Resources.[[ImageName]]
for eg:this.pictureBox1.Image = global::[[MyNameSpace]].Properties.Resources.[[ImageName]]

Categories