使用C#保护图像?帮助! [英] Securing Images with C#? help!

查看:80
本文介绍了使用C#保护图像?帮助!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个执行以下操作的应用程序
1.检索存储在数据库中的图像
2.将其复制到硬盘上的某个位置
3.显示图像
我该怎么办?
4.删除该图像并仍在查看器中显示它,或者即使我可以某种方式保护我的图像,这也将对我有效

我正在使用由jordy Ruiter从codeproject构建的KpImageViewer,在这里,当我像

I am creating an application that does the following
1. Retrieves images stored in the db
2. Copies it to a location on the hard disk
3. Displays the image
how do i do this?
4. delete the image and still show it in my viewer or even if i could secure my image in some way, that would also work for me

I am using KpImageViewer that was built by jordy Ruiter from codeproject and in here, when i use the Dispose on the image viewer as in

kpImageViewer1.dispose();

函数中那样在图像查看器上使用Dispose时,图像也将获得删除,所以我尝试

function the image also gets deleted so i tried

kpImageViewer.Image.Dispose();

将图像保留在内存中,但是现在我无法滚动图像.

如果有人可以向我展示确保我的图像安全的方法,我将感到非常高兴.然后加密或类似的加密方法或解决该问题的方法

that keeps the image in memory but now i cannot scroll through the image.

I would be glad if someone could show me the way to either securing my images eg. encrypting then or something of that sort or a way around keeping this problem

推荐答案

步骤1-3在网络上被广泛报道.他们是微不足道的.但是,当您从数据库获取图像的字节时,可以将其加载到图像中,而无需将其存储到HDD中.网络上也广泛报道了Bitmap.FromStream,这是您需要执行的操作.一旦您的图像查看器获得了图像,它可能需要文件的唯一原因就是是否要平铺图像,如果控件做到了,您可能就无能为力了.如果您对图像进行编码(这很容易做到),则在图像查看器尝试读取图像之前,需要先对其进行解码,然后再将其保存到HDD中.

您认为图像中的哪些国家机密是人们会试图窃取它们的?如果它们很有价值,什么会阻止它们打中Control-PrintScreen并只是从查看器内部抓取它们?
Steps 1-3 are widely reported about on the web. They are trivial. However, when you get the bytes of the image from the DB, you can load them in to an Image without storing them to the HDD. This is also widely reported on the web, Bitmap.FromStream is what you need to do this. Once your image viewer has the image, the only reason it could have for needing the file, is if it''s tiling the image, if your control does that, you probably can''t do a thing. If you encode the image, which is easy to do, it would need to be decoded before it''s saved to the HDD, if your image viewer is trying to read it.

What national secrets are in your images that you think people will try to steal them ? What will stop them from hitting Control-PrintScreen and just grabbing them from inside your viewer, if they are that valuable ?


这篇关于使用C#保护图像?帮助!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆