资源简介
基于离散余弦变换的数字水印潜入算法,可以直接运行的源代码

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Imaging;
namespace InformationHide
{
public partial class Form1 : Form
{
Image originalimage;
Image watermark;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Button btnAddCopyright;
///
/// Required designer variable.
///
public Form1()
{
InitializeComponent();
}
private void btnOpenFile_Click(object sender EventArgs e)
{
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.InitialDirectory = @“C:\Users\zd\Desktop“;
openFileDialog1.Filter = “All files (*.*)|*.*“;
openFileDialog1.FilterIndex = 2;
openFileDialog1.RestoreDirectory = true;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
originalimage = System.Drawing.Image.FromFile(openFileDialog1.FileName.ToString());
Image ithumbnail = originalimage.GetThumbnailImage(pictureBox1.Width pictureBox1.Height null new IntPtr());
pictureBox1.Image = ithumbnail;
btnAddCopyright.Enabled = true;
}
}
private void btnAddCopyright_Click(object sender System.EventArgs e)
{
int imagewidth;
int imageheight;
int fontsize = 20;
int x y;
int a re gr bl x1 y1 z1;
int size;
Bitmap pattern;
SizeF sizeofstring;
bool foundfont;
imagewidth = originalimage.Width;
imageheight = originalimage.Height;
size = imagewidth * imageheight;
pattern = new Bitmap(imagewidth imageheight);//创建一个二进制位图
Bitmap temp = new Bitmap(originalimage);//原位图图像
Graphics g = Graphics.FromImage(pattern);
//Graphics g = Graphics.FromImage(watermark);
Graphics tempg = Graphics.FromImage(originalimage);
//find a font size that will fit in the bitmap
foundfont = false;
g.Clear(Color.White);
while (foundfont == false)
{
Font fc = new Font(“Georgia“ fontsize System.Drawing.Fontstyle.Italic);
sizeofstring = new SizeF(imagewidth imageheight);
sizeofstring = g.MeasureString(textBox1.Text fc);
if (sizeofstring.Width < pattern.Width)
{
if (sizeofstring.Height < pattern.Height)
{
foundfont = true;
g.DrawString(textBox1.Text fc new S
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2011-06-30 08:54 InformationHide\
目录 0 2011-06-30 08:54 InformationHide\InformationHide\
文件 887 2011-06-28 11:25 InformationHide\InformationHide.sln
文件 20992 2011-07-02 14:50 InformationHide\InformationHide.suo
目录 0 2011-06-30 08:54 InformationHide\InformationHide\bin\
目录 0 2011-06-30 08:54 InformationHide\InformationHide\bin\Debug\
文件 11776 2011-07-02 14:47 InformationHide\InformationHide\bin\Debug\InformationHide.exe
文件 26112 2011-07-02 14:47 InformationHide\InformationHide\bin\Debug\InformationHide.pdb
文件 11600 2011-07-02 14:50 InformationHide\InformationHide\bin\Debug\InformationHide.vshost.exe
文件 490 2010-03-17 22:39 InformationHide\InformationHide\bin\Debug\InformationHide.vshost.exe.manifest
文件 5644 2011-07-02 14:47 InformationHide\InformationHide\Form1.cs
文件 5774 2011-07-02 14:38 InformationHide\InformationHide\Form1.Designer.cs
文件 5817 2011-07-02 14:38 InformationHide\InformationHide\Form1.resx
文件 3689 2011-06-28 11:35 InformationHide\InformationHide\InformationHide.csproj
目录 0 2011-06-30 08:54 InformationHide\InformationHide\obj\
目录 0 2011-06-30 08:54 InformationHide\InformationHide\obj\x86\
目录 0 2011-07-02 14:47 InformationHide\InformationHide\obj\x86\Debug\
文件 4440 2011-06-28 21:00 InformationHide\InformationHide\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 6253 2011-07-02 14:47 InformationHide\InformationHide\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 514 2011-07-02 14:38 InformationHide\InformationHide\obj\x86\Debug\GenerateResource.read.1.tlog
文件 1458 2011-07-02 14:38 InformationHide\InformationHide\obj\x86\Debug\GenerateResource.write.1.tlog
文件 1535 2011-07-02 14:50 InformationHide\InformationHide\obj\x86\Debug\InformationHide.csproj.FileListAbsolute.txt
文件 11776 2011-07-02 14:47 InformationHide\InformationHide\obj\x86\Debug\InformationHide.exe
文件 180 2011-07-02 14:38 InformationHide\InformationHide\obj\x86\Debug\InformationHide.Form1.resources
文件 26112 2011-07-02 14:47 InformationHide\InformationHide\obj\x86\Debug\InformationHide.pdb
文件 180 2011-06-30 08:57 InformationHide\InformationHide\obj\x86\Debug\InformationHide.Properties.Resources.resources
文件 7897 2011-06-28 23:04 InformationHide\InformationHide\obj\x86\Debug\ResolveAssemblyReference.cache
目录 0 2011-06-28 11:25 InformationHide\InformationHide\obj\x86\Debug\TempPE\
文件 496 2011-06-28 11:25 InformationHide\InformationHide\Program.cs
目录 0 2011-06-30 08:54 InformationHide\InformationHide\Properties\
文件 1362 2011-06-28 11:25 InformationHide\InformationHide\Properties\AssemblyInfo.cs
............此处省略4个文件信息
- 上一篇:LPC1778FBD144原理图库
- 下一篇:学生信息采集模板
相关资源
- 信息隐藏与数字水印实验指导电子教
- 水印-信息隐藏
- 信息隐藏期末项目和报告
- 量化索引抖动调制水印嵌入与提取
- 隐写分析与数字取证
- BMP图像的信息隐藏
- 计算机病毒实验 信息隐藏
- 基于24位bmp位图的信息隐藏编程
- 信息隐藏技术实验教程 PDF
- 信息隐藏与数字水印
- 信息隐藏隐写与分析
- 基于图像的信息隐藏两个算法(LSB和
- 信息隐藏实验报告以及原程序
- 信息隐藏技术—隐写术与数字水印北
- 信息隐藏标准测试图片库
- 可逆信息隐藏
- BMP图像中的LSB信息隐藏方法
- 信息隐藏技术_PDF格式剖析及信息隐藏
- 信息隐藏与数字水印实验教程
- 信息隐藏研究与发展综述
- 信息隐藏代码
- 基于DCT变换信息隐藏图片嵌入水印课
- 一种基于LSB图像信息隐藏的改进算法
- 信息隐藏复习参考题
- RS隐写分析算法 信息隐藏与数字水印
- LSB算法实现信息隐藏
- 武汉大学信息隐藏考试资料
- WAV音频的LSB信息隐藏
- 信息隐藏报告.rar
- 基于同态公钥加密系统的图像可逆信
评论
共有 条评论