- 浏览: 84501 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
burningman:
没看明白什么意思。
WebService身份验证解决方案 -
minglelui:
调用的是webservice。服务器端调用webservice ...
Java使用httprequest来访问WebService3 -
containsoft:
楼主,你这是调用的webservice还是servlet啊?一 ...
Java使用httprequest来访问WebService3
Sub Initialize()
Dim s As New NotesSession
Dim db As NotesDatabase
Set db = s.Currentdatabase
'Set db = New NotesDatabase( "YourServer/svr/somewhere", "database.nsf")
Call ExtractImageResources( db, "J:\temp" )
End Sub
Sub ExtractImageResources(db As NotesDatabase, DestinationDirectory As String)
' =========================================================
' Extracts all GIF and JPG image resource file to <DestinationDirectory>
' DestinationDirectory must exist.
' This code creates 1 tempfile in dest. directory.
' =========================================================
Dim session As New NotesSession
Dim DestinationDir As String
Dim debug As Integer
Dim nc As NotesNoteCollection
Dim exporter As NotesDXLExporter
Dim stream As NotesStream
Dim DXLTempfile As String
Dim inputStream As NotesStream
Dim domParser As NotesDOMParser
Dim RootNode As NotesDOMDocumentNode
Dim n1 As Integer
Dim i As Integer
Dim ImageResource_Nodes As NotesDOMNodeList
Dim MyNode As NotesDOMElementNode
Dim TempNode As NotesDOMElementNode
Dim TempChildNode As NotesDOMNode
Dim MyNodeList As NotesDOMNodeList
Dim attr As NotesDOMAttributeNode
Dim IRFilename As String
Dim MimeEntity As NotesMIMEEntity
Dim outStream As NotesStream
Dim doc As NotesDocument
On Error GoTo err1
debug = 1 ' set to 0 for no debg output
DestinationDir = Trim$(DestinationDirectory)
If Right$( DestinationDir, 1)<>"\" Then DestinationDir = DestinationDir+"\"
' ====================================================
' Define tempfiles - if you manage to make the DXL export/import
' work without tempfiles, let me know !
' =====================================================
DXLTempfile = DestinationDir & "tmp_fileresources.dxl"
' ========================
' Create DXL export stream
' ========================
On Error Resume Next
Kill( DXLTempfile)
On Error GoTo err1
Set stream = session.CreateStream
If Not stream.Open( DXLTempfile,"UTF-8") Then
MessageBox "Cannot create " & DXLTempfile,, "Error"
Exit Sub
End If
Call stream.Truncate
' ===============================
' Build collection of design elements
' ===============================
If debug = 1 Then Print "Building design note document collection"
' ================================
' Export DesignNoteCollection as DXL
' ================================
If debug = 1 Then Print "Exporting image resources to " & DXLTempfile
'Set exporter = session.CreateDXLExporter(nc, stream)
Dim docExport As NotesDocument
Set docExport = db.Getdocumentbyunid("047D60B5DA6AAE384825776800317812")
Set exporter = session.CreateDXLExporter(docExport, stream)
Call exporter.Process
Call stream.Close
' =========================
' Import DXL for parsing
' =========================
If debug = 1 Then Print "Creating DXL import stream from " & DXLTempfile
Set inputStream = session.CreateStream
Call inputStream.Open ( DXLTempfile ,"UTF-8")
' =========================
' Parse DXL
' =========================
Print "Parsing DXL"
Set domParser=session.CreateDOMParser(inputStream)
domParser.Process
' =======================
' Get the root node
' ======================
Set rootNode = domParser.Document
' =========================
' Get all ImageResourceNodes
' =========================
'Set ImageResource_Nodes = RootNode.GetElementsByTagName( "imageresource" )
Set ImageResource_Nodes = RootNode.GetElementsByTagName( "jpeg" )
If debug=1 Then Print "Found " & ImageResource_Nodes.NumberOfEntries & " image resources"
If ImageResource_Nodes.NumberOfEntries=0 Then
Print "No <imageresource> node found - exiting"
GoTo finish
End If
' =============================================
' Browse all <imageresource> nodes and extract images
' from <gif> / <jpeg> child nodes
' =============================================
IRFilename = "DLTitle.jpg"
Set TempNode = ImageResource_Nodes.GetItem(1)
Set TempChildNode = TempNode.firstchild
' TempChild.NodeValue contains the base64 encoded image data
' Create output stream / file
If debug=1 Then Print "Create output file " & DestinationDir & IRFilename
Set outStream = session.CreateStream
On Error Resume Next
Kill (DestinationDir & IRFilename)
On Error GoTo err1
Call outStream.Open( DestinationDir & IRFilename, "binary")
' Create Input Stream and write Base64 data to stream
Set stream = session.CreateStream
MsgBox CStr(TempChildNode.NodeValue)
Call stream.WriteText(TempChildNode.NodeValue)
' Decode base64 and write to outstream / file
If debug=1 Then Print "Decoding Base64 to binary"
Set doc = New NotesDocument(session.CurrentDatabase )
Set MimeEntity = doc.CreateMIMEEntity
Call MimeEntity.SetContentFromBytes(stream,"", ENC_BASE64)
Call MimeEntity.GetContentAsBytes(outStream, True)
Call MimeEntity.DEcodeContent()
Call outstream.Close
Call stream.close
Call inputstream.close
finish:
If debug=1 Then Print "Removing tempfiles"
On Error Resume Next
Kill(DXLTempfile)
On Error GoTo err1
Print
Exit Sub
err1:
Print Error$ & " in line " & Erl
MessageBox Error$ & " in line " & Erl
Exit Sub
End Sub
Dim s As New NotesSession
Dim db As NotesDatabase
Set db = s.Currentdatabase
'Set db = New NotesDatabase( "YourServer/svr/somewhere", "database.nsf")
Call ExtractImageResources( db, "J:\temp" )
End Sub
Sub ExtractImageResources(db As NotesDatabase, DestinationDirectory As String)
' =========================================================
' Extracts all GIF and JPG image resource file to <DestinationDirectory>
' DestinationDirectory must exist.
' This code creates 1 tempfile in dest. directory.
' =========================================================
Dim session As New NotesSession
Dim DestinationDir As String
Dim debug As Integer
Dim nc As NotesNoteCollection
Dim exporter As NotesDXLExporter
Dim stream As NotesStream
Dim DXLTempfile As String
Dim inputStream As NotesStream
Dim domParser As NotesDOMParser
Dim RootNode As NotesDOMDocumentNode
Dim n1 As Integer
Dim i As Integer
Dim ImageResource_Nodes As NotesDOMNodeList
Dim MyNode As NotesDOMElementNode
Dim TempNode As NotesDOMElementNode
Dim TempChildNode As NotesDOMNode
Dim MyNodeList As NotesDOMNodeList
Dim attr As NotesDOMAttributeNode
Dim IRFilename As String
Dim MimeEntity As NotesMIMEEntity
Dim outStream As NotesStream
Dim doc As NotesDocument
On Error GoTo err1
debug = 1 ' set to 0 for no debg output
DestinationDir = Trim$(DestinationDirectory)
If Right$( DestinationDir, 1)<>"\" Then DestinationDir = DestinationDir+"\"
' ====================================================
' Define tempfiles - if you manage to make the DXL export/import
' work without tempfiles, let me know !
' =====================================================
DXLTempfile = DestinationDir & "tmp_fileresources.dxl"
' ========================
' Create DXL export stream
' ========================
On Error Resume Next
Kill( DXLTempfile)
On Error GoTo err1
Set stream = session.CreateStream
If Not stream.Open( DXLTempfile,"UTF-8") Then
MessageBox "Cannot create " & DXLTempfile,, "Error"
Exit Sub
End If
Call stream.Truncate
' ===============================
' Build collection of design elements
' ===============================
If debug = 1 Then Print "Building design note document collection"
' ================================
' Export DesignNoteCollection as DXL
' ================================
If debug = 1 Then Print "Exporting image resources to " & DXLTempfile
'Set exporter = session.CreateDXLExporter(nc, stream)
Dim docExport As NotesDocument
Set docExport = db.Getdocumentbyunid("047D60B5DA6AAE384825776800317812")
Set exporter = session.CreateDXLExporter(docExport, stream)
Call exporter.Process
Call stream.Close
' =========================
' Import DXL for parsing
' =========================
If debug = 1 Then Print "Creating DXL import stream from " & DXLTempfile
Set inputStream = session.CreateStream
Call inputStream.Open ( DXLTempfile ,"UTF-8")
' =========================
' Parse DXL
' =========================
Print "Parsing DXL"
Set domParser=session.CreateDOMParser(inputStream)
domParser.Process
' =======================
' Get the root node
' ======================
Set rootNode = domParser.Document
' =========================
' Get all ImageResourceNodes
' =========================
'Set ImageResource_Nodes = RootNode.GetElementsByTagName( "imageresource" )
Set ImageResource_Nodes = RootNode.GetElementsByTagName( "jpeg" )
If debug=1 Then Print "Found " & ImageResource_Nodes.NumberOfEntries & " image resources"
If ImageResource_Nodes.NumberOfEntries=0 Then
Print "No <imageresource> node found - exiting"
GoTo finish
End If
' =============================================
' Browse all <imageresource> nodes and extract images
' from <gif> / <jpeg> child nodes
' =============================================
IRFilename = "DLTitle.jpg"
Set TempNode = ImageResource_Nodes.GetItem(1)
Set TempChildNode = TempNode.firstchild
' TempChild.NodeValue contains the base64 encoded image data
' Create output stream / file
If debug=1 Then Print "Create output file " & DestinationDir & IRFilename
Set outStream = session.CreateStream
On Error Resume Next
Kill (DestinationDir & IRFilename)
On Error GoTo err1
Call outStream.Open( DestinationDir & IRFilename, "binary")
' Create Input Stream and write Base64 data to stream
Set stream = session.CreateStream
MsgBox CStr(TempChildNode.NodeValue)
Call stream.WriteText(TempChildNode.NodeValue)
' Decode base64 and write to outstream / file
If debug=1 Then Print "Decoding Base64 to binary"
Set doc = New NotesDocument(session.CurrentDatabase )
Set MimeEntity = doc.CreateMIMEEntity
Call MimeEntity.SetContentFromBytes(stream,"", ENC_BASE64)
Call MimeEntity.GetContentAsBytes(outStream, True)
Call MimeEntity.DEcodeContent()
Call outstream.Close
Call stream.close
Call inputstream.close
finish:
If debug=1 Then Print "Removing tempfiles"
On Error Resume Next
Kill(DXLTempfile)
On Error GoTo err1
Exit Sub
err1:
Print Error$ & " in line " & Erl
MessageBox Error$ & " in line " & Erl
Exit Sub
End Sub
发表评论
-
代码复用的小例子
2010-09-10 14:46 831Sub CodeShare(Source As Button) ... -
扩展Implode方法
2010-09-09 18:01 1059问题描述:Lotuscript中提供的Implode对整数数组 ... -
Excel编程
2010-09-07 15:46 930xlWorkSheet.Cells(1,iYear).Valu ... -
如何获取视图中列的多值域的值?
2010-09-07 14:45 1143http://www-10.lotus.com/ldd/nd6 ... -
创建时间域
2010-09-03 15:23 752Dim dt As NotesDateTime Dim dtI ... -
如何察看隐藏视图
2010-08-30 14:12 728goto可以间接查看视图 按着ctrl+shift,通过got ... -
About response doc
2010-08-26 10:13 782http://www.dominopower.com/issu ... -
NotesUIDocument和NotesDocument的差别
2010-08-10 11:52 1404测试目的:某域值更新后,隐藏条件设置与次域有关的相关域的隐藏立 ... -
Is Not a form
2010-08-06 11:15 785http://www-10.lotus.com/ldd/nd8 ... -
删除Profile文档的几种方法
2010-07-16 16:17 1056http://www-01.ibm.com/support/d ... -
Java agent
2010-07-15 11:09 795http://space.itpub.net/10114847 ... -
lotus 8.5
2010-07-09 13:44 651http://space.itpub.net/14751907 ... -
外发邮件挂起的处理
2010-06-25 11:10 941Question: You have outgoing ma ... -
邮件链接
2010-06-14 14:56 693拷贝数据库链接然后另存为ndl文件 http://we ... -
在Notes视图中游弋
2010-06-11 00:47 747Sub Initialize() Dim session As ... -
运行代理权限问题
2010-06-10 16:43 896Just to head off any technical ... -
在Lotus开发中引入jar包
2010-06-06 21:31 727http://www.docin.com/p-41744081 ... -
实时更新RTF域的内容
2010-06-05 23:54 715call uidoc.close call ws.editd ... -
读取RTF域中的Table
2010-06-05 23:50 980This code is designed to create ... -
在RTF域中添加Table
2010-06-05 23:48 1467Developers sometimes need to re ...
相关推荐
Excel百宝箱 9.0 破解版 批量导入图片等200种功能 Excel2007 Excel百宝箱2012是强大的制表插件,当安装百宝箱后,如果您使用Excel 2003,则将产生【百宝箱】菜单,包括100多个子菜单;如果您使用Excel 2007或者2010...
7. **二进制数据还原**:从数据库中取出BLOB数据,再转换回图片文件格式,显示或保存到本地。 8. **用户界面交互**:通过文件选择对话框获取用户选择的图片文件,提供进度反馈,以及可能出现的错误处理。 9. **...
ImagesWriter.htm页面 主要是 输入图片的文件夹,程序去搜索文件将文件转换成二进制数据导入数据库中。ImagesRead.htm 主要是显示图片和将数据库中的二进制数据生成图片保存到硬盘上。图片导入导出都带有真实的...
`将.pvr.ccz和plist文件还原为多个原图-工具`是一个专为此目的设计的工具,它可以帮助开发者或学习者将游戏中的`.pvr.ccz`和`.plist`资源解包成原始的图片格式,如.png或.jpg,以便于查看、编辑或再利用。...
1. 读取图片文件:使用“文件打开”命令打开图片文件,然后用“文件读取”命令读取全部内容到字节集。 2. 将字节集转换为图片:关闭文件后,利用“位图创建”或“位图加载”命令,传入字节集和图片格式信息,生成...
这些格式的图片文件都可以被解析为字节集,然后再转换回图片。图片到字节集的转换通常在上传图片、保存图片为二进制文件或者在网络传输中使用。 易语言字节集转图片的过程主要包括以下几个步骤: 1. **读取字节集*...
然而,在某些情况下,我们可能需要将这些合并后的图集还原为原始的单个图片,以便进行修改、替换或者单独使用。下面我们将详细探讨如何实现这个过程,并以Python脚本`unpack_plist.py`为例,讲解其工作原理。 ....
在这个场景中,我们关注的是如何将二进制图片文件转换为Base64字符串文本,以及如何将这个Base64字符串再还原回图片。这在数据传输、存储或者网页显示等方面非常有用,因为Base64编码可以将二进制数据转换为ASCII...
3. 解压缩:工具将读取.plist文件的内容,并根据指示解压.pvr.ccz文件,将压缩的纹理还原为一组或多组未压缩的图片。 4. 输出和编辑:解压后,你可以查看和编辑这些图片,进行必要的修改。完成编辑后,如果需要,你...
宏-图片提取-ImagesOutIn(去图片).dot则可能是宏的模板文件,其中包含了用于提取和还原图片的具体代码。通常,.dot文件是Word的模板格式,用于保存宏和其他自定义设置,供后续文档创建时使用。 要实现图片提取和...
例如有两张名为“诺基亚8310”、“诺基亚7600”的图片,只需要在单元格输入“诺基亚”就行了,导入图片时可以将“诺基亚”开头的图片全部导入。 5.数量灵活:对于多个图片符合同一单元格名称的状况,可以将所有图片...
1. 输入:用户输入或导入包含16进制数据的文件。 2. 解析:工具将16进制字符串转换为原始的二进制流。 3. 分析:分析二进制流是否符合JPEG的文件结构,例如寻找SOI(Start of Image)和EOI(End of Image)标记。 4....
Cocos图片逆向工具是一款专为游戏开发人员设计的实用软件,主要用于处理和拆解已打包的.plist图片文件。在游戏开发过程中,为了优化资源管理,开发者常常会将多张图片打包成一个.plist文件,这样的文件通常包含了...
在图片存入数据库的过程中,首先要读取图片文件,这通常使用VB的FileOpen、Input#或BinaryRead等函数完成。读取的图片数据被转换为字节数组,然后通过ADO的参数化查询方式,将字节数组作为值传入SQL的INSERT语句,...
通过遍历指定目录下的所有图片文件,对每张图片执行相同的切割和保存过程。这在数据扩增中很有用,例如在训练机器学习模型时,可以通过这种方式增加数据的多样性。 综上所述,这个知识点涉及以下几个核心概念: 1....
例如有两张名为“诺基亚8310”、“诺基亚7600”的图片,只需要在单元格输入“诺基亚”就行了,导入图片时可以将“诺基亚”开头的图片全部导入。 5.数量灵活:对于多个图片符合同一单元格名称的状况,可以将所有图片...
这个工具可能包含了一个`dll`(动态链接库)文件,这是Windows系统下的一个可执行组件,用于执行特定的功能,比如解析`plist`文件并将其内容导出为PNG图片。`PlistToPng.win32`可能就是这个工具的Windows 32位版本,...
描述中提到的“图片批量修改名称”可能是指根据Excel文件中的信息(如图片原始名称或与图片相关的其他数据)来更新图片文件的名称。假设我们有Excel表格的第一列存储了图片的原始名称,第二列是新名称,可以这样做:...
使用说明.pdf文件很可能是提供关于如何操作这个软件的详细指南,包括如何导入图片、选择色彩模式、调整参数以及导出取模结果等内容。对于初次使用的开发人员来说,这份文档是非常重要的参考资料,可以帮助他们快速...
步骤一:打开Photoshop并导入图片。启动Photoshop软件,选择“文件”>“打开”,将偏暗的外景美女图片导入到工作区。 步骤二:复制背景图层。为了保持原始图片不受影响,通常我们会习惯性地复制背景图层(快捷键...