蓝版,我们现在遇到的问题是,图片担心别人翻拍泄漏,所以初步是想通过水印解决,有其他解决方案吗
使用Photoshop等图片处理软件给图片加上水印,再添加到图片管理器中
'主图
Dim imgback As image = getimage("d:\1796308622301859841.jpg") '主图
Dim bmp As New bitmap(imgback.width, imgback.height)
Dim g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(bmp)
g.DrawImage(imgback, 0, 0, imgback.Width, imgback.Height) '绘制主图'
'文字
Dim fnt As New Font("宋体", 16)
Dim msg As String = Vars("帐号")
g.DrawString(msg, fnt, Brushes.Black, 100, 100)
g.DrawString(msg, fnt, Brushes.Black, 200, 200)
g.DrawString(msg, fnt, Brushes.Black, 300, 300)
'保存图片
bmp.Save("d:\c.jpg") '保存
bmp.dispose '释放资源'
MessageBox.Show("打印成功")
那就不能使用内置的图片管理器了,自己及设计窗口,使用图片管理器控件,然后添加一个按钮用来上传文件,上传前先使用上面的代码给图片添加文字,保存后再上传:http://www.foxtable.com/webhelp/topics/2699.htm、
http://www.foxtable.com/webhelp/topics/1410.htm
Dim dlg As New OpenFileDialog
Dim piv As WinForm.PictureViewer = e.Form.Controls("PictureViewer1")
dlg.Filter= "图形文件|*.bmp;*.jpg;*.gif"
If dlg.ShowDialog = DialogResult.OK Then
'主图 Dim imgback As image = getimage(dlg.FileName) '主图 |
....图片添加文字的其代码bmp.Save("d:\c.jpg") '保存到一个指定的目录
bmp.dispose '释放资源'
Dim ftp1 As New FtpClient
ftp1.Host="196.128.143.28"
ftp1.Account = "foxuser"
ftp1.Password = "138238110"
If ftp1.Upload("d:\c.jpg","\c.jpg") = True Then
piv.AddFile("c.jpg")
Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Else
Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
End If