Well after fiddling around, I found that I had to do the save within the
same procedure that I executed the SaveDialog from. I don't know why this is
because the SaveDialog is a control I added to the form and hence should be
a global object rather than a local object only seen by the procedure that
> I am trying to save a simple bitmap image using the
> Image.Canvas.SaveToFile(SavePictureDialog.Filename) method but whenver I
> the filename value is all corrupted. I've tried just using the SaveDialog
> well and it does the same thing.
> I have tried setting the Filename property during the design phase and
> checking the value (via a messagebox) before and after using the
> Before I use the SaveDialog the Filename property is good 'test.bmp' but
> after I use the SaveDialog it ends up as a random string of strange
> If I do the Image.Canvas.SaveToFile(SavePictureDialog.Filename) method
> without using the dialog to set the name, the file saves to the filename
> that I chose in the design phase but gets an error (because of the strange
> characters) if I choose a filename with the SaveDialog.
> Is there something wrong with the Dialogs? Or is there something I need to
> do to initialise them? Surely it should just store the value of the file
> name and the value of the directory in the properties without needing to
> anything else. The only other Dialog I have tried is the ColorDialog and
> works fine, ie. it returns the a color value to the Color property of the
> ColorDialog control.