Hjg.Pngcs.PngReader.End C# (CSharp) Method

End() public method

Normally this does nothing, but it can be used to force a premature closing
public End ( ) : void
return void
        public void End()
        {
            if (CurrentChunkGroup < ChunksList.CHUNK_GROUP_6_END)
                Close();
        }

Usage Example

コード例 #1
0
        private void btnOpen_Click( object sender, RoutedEventArgs e )
        {
            CommonOpenFileDialog openDialog = new CommonOpenFileDialog();
              openDialog.ShowPlacesList = true;
              openDialog.Multiselect = false;
              openDialog.IsFolderPicker = false;
              openDialog.AddToMostRecentlyUsedList = true;
              openDialog.Filters.Add( new CommonFileDialogFilter( "PNG images", "*.png" ) );
              if ( openDialog.ShowDialog( this ) == CommonFileDialogResult.Ok ) {
            soureFilePath = openDialog.FileName;
            // get comment meta
            using ( FileStream fileStream = new FileStream( soureFilePath, FileMode.Open, FileAccess.Read ) ) {
              pngReader = new PngReader( fileStream );
              // 参考自Hjg.Pngcs的SampleCustomChunk项目
              // get last line: this forces loading all chunks
              pngReader.ReadChunksOnly();
              tblkComment.Text = pngReader.GetMetadata().GetTxtForKey( Key_SemanticInfo );
              pngReader.End();
              fileStream.Close();
            }

            image.BeginInit();
            image.Source = new BitmapImage( new Uri( soureFilePath ) );
            image.EndInit();
              }
        }
All Usage Examples Of Hjg.Pngcs.PngReader::End