Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 11th, 2004, 10:18 AM
Authorized User
 
Join Date: Jun 2003
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default Unknown File Format - how to solve

Hi;
I use the method below to save an image showed in a Picture Box using the SaveFileDialog.

protected void SaveImage()
{
  try
    {
    Stream stream = File.OpenWrite (this.CaminhoImagem);
      using (StreamWriter writer = new StreamWriter (stream))
      {
        writer.Write (this.pctImagem.Image.Clone ()); }
    }
catch (IOException ex)
    {
    MessageBox.Show (ex.Message, "Harpia - Erro de Gravação",
    MessageBoxButtons.OK, MessageBoxIcon.Error);
    }
}//final do metodo

The method running very well and don't show me any error.
Is impossible to open the saved image because the image format is wrong. Always i'm seeing the message: "UNKNOWN FILE FORMAT".
How can i solve this problem???
 
Old February 12th, 2004, 10:41 AM
Authorized User
 
Join Date: Jun 2003
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Debtor Cheers for its reply...

To solve the problem i used:

this.pctImagem.Image.Save (this.CaminhoImagem);

Thanks again...





Similar Threads
Thread Thread Starter Forum Replies Last Post
Error in File UNKNOWN.RPT babarrana Crystal Reports 0 September 17th, 2007 05:47 AM
format .fla file with c# pratik28 C# 0 August 6th, 2006 07:55 AM
Search for unknown charictors in a txt file broadbandguru VB How-To 3 September 16th, 2005 05:46 PM
convert a js file from a asp file - change format jstewie Javascript How-To 0 July 21st, 2005 08:57 AM
help with dtd file format jsbxml XML 0 January 17th, 2005 04:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.