CleanImage()的相反命令是什么
What is the opposite command of CleanImage()
CleanImage(基本图像)
允许在不获取对话框的情况下删除图像:"Do you want to save ..."
除了给整个图像(8k x 8k)加零之外,还有相反的部分吗?喜欢:
脏图(基本图像)
谢谢!
No, such a command does not exist, but it also isn't really useful.
Any action on an imageDocument will automaticaly mark it dirty (i.e. needs to be saved), so you can easily do this by f.e. adding/removing a tag; setting a pixelvalue temporarily; moving the window, etc.
命令CleanImage()
真的只是一个方便的功能。实际的 属性 "is different from stored file" 是 ImageDocument 的 属性,保存到的东西光盘。
因此,该命令实际上对没有 ImageDocument 的图像没有任何作用,即从未显示、保存或具有 ImageGetOrCreateImageDocument()
呼吁他们。你可以在这里看到这个:
image img := RealImage( "test", 4, 100, 100 )
If ( TwoButtonDialog("Show?","Yes","No") )
img.ShowImage()
If ( TwoButtonDialog("Try closing before cleaning?","Yes","No") )
img.CloseImage()
else
{
img.CleanImage()
img.CloseImage()
}
命令真正匹配到:
void ImageDocumentClean( ImageDocument imgDoc )
检查 imageDocument 是否需要保存的命令是
Boolean ImageDocumentIsDirty( ImageDocument img_doc )
因此,更常见的是,人们会改用这些命令,就像我在下面的脚本中所做的那样。
以下脚本显示了如何轻松地 "dirty" 一个 imageDocument 只需重新设置其中一个像素值。请注意,此脚本的工作独立于显示图像,因为我们明确创建了 ImageDocument。
Result( "\n Create Image... ")
image img := RealImage( "test", 4, 100, 100 )
Result( "\n Get it's ImageDocument... ")
imageDocument doc = img.ImageGetOrCreateImageDocument()
Result( "\n Is it dirty? --> " + (doc.ImageDocumentIsDirty()?"Yes, dirty":"No, clean"))
Result( "\n Clean it!" )
doc.ImageDocumentClean()
Result( "\n Is it dirty? --> " + (doc.ImageDocumentIsDirty()?"Yes, dirty":"No, clean"))
Result( "\n Make it dirty by setting the first pixel value to the value it has..." )
img.SetPixel(0,0,img.GetPixel(0,0))
Result( "\n Is it dirty? --> " + (doc.ImageDocumentIsDirty()?"Yes, dirty":"No, clean"))
但是,我很好奇什么时候需要这样的功能?
CleanImage(基本图像) 允许在不获取对话框的情况下删除图像:"Do you want to save ..."
除了给整个图像(8k x 8k)加零之外,还有相反的部分吗?喜欢:
脏图(基本图像)
谢谢!
No, such a command does not exist, but it also isn't really useful.
Any action on an imageDocument will automaticaly mark it dirty (i.e. needs to be saved), so you can easily do this by f.e. adding/removing a tag; setting a pixelvalue temporarily; moving the window, etc.
命令CleanImage()
真的只是一个方便的功能。实际的 属性 "is different from stored file" 是 ImageDocument 的 属性,保存到的东西光盘。
因此,该命令实际上对没有 ImageDocument 的图像没有任何作用,即从未显示、保存或具有 ImageGetOrCreateImageDocument()
呼吁他们。你可以在这里看到这个:
image img := RealImage( "test", 4, 100, 100 )
If ( TwoButtonDialog("Show?","Yes","No") )
img.ShowImage()
If ( TwoButtonDialog("Try closing before cleaning?","Yes","No") )
img.CloseImage()
else
{
img.CleanImage()
img.CloseImage()
}
命令真正匹配到:
void ImageDocumentClean( ImageDocument imgDoc )
检查 imageDocument 是否需要保存的命令是
Boolean ImageDocumentIsDirty( ImageDocument img_doc )
因此,更常见的是,人们会改用这些命令,就像我在下面的脚本中所做的那样。
以下脚本显示了如何轻松地 "dirty" 一个 imageDocument 只需重新设置其中一个像素值。请注意,此脚本的工作独立于显示图像,因为我们明确创建了 ImageDocument。
Result( "\n Create Image... ")
image img := RealImage( "test", 4, 100, 100 )
Result( "\n Get it's ImageDocument... ")
imageDocument doc = img.ImageGetOrCreateImageDocument()
Result( "\n Is it dirty? --> " + (doc.ImageDocumentIsDirty()?"Yes, dirty":"No, clean"))
Result( "\n Clean it!" )
doc.ImageDocumentClean()
Result( "\n Is it dirty? --> " + (doc.ImageDocumentIsDirty()?"Yes, dirty":"No, clean"))
Result( "\n Make it dirty by setting the first pixel value to the value it has..." )
img.SetPixel(0,0,img.GetPixel(0,0))
Result( "\n Is it dirty? --> " + (doc.ImageDocumentIsDirty()?"Yes, dirty":"No, clean"))
但是,我很好奇什么时候需要这样的功能?