VB Questions

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
User avatar
Patrickh




Wordewatician 500

Posts: 1173
Joined: Wed Mar 14, 2007 4:53 pm

Post by Patrickh »

Yeah, I did that, but it's saves the image as .file, which rather unusable. If someone could tell me the problem, that'd be great. Thanks for all the help
Image
conure says: or i could jsut incase my shoes in papar mache, followed by my dog
|||Lethargy||| Mr. Mohawk|||
|||feel free to contact me via PMs, AIM, MSNM, or Xfire if you have any questions|||
OwnZ joO




Articulatist 500

Posts: 980
Joined: Thu Nov 10, 2005 4:24 pm

Post by OwnZ joO »

Patrickh wrote:Yeah, I did that, but it's saves the image as .file, which rather unusable. If someone could tell me the problem, that'd be great. Thanks for all the help
Did you specify a full filepath with .bmp at the end of it? I don't use image saving stuff, but that would be my guess.
User avatar
Patrickh




Wordewatician 500

Posts: 1173
Joined: Wed Mar 14, 2007 4:53 pm

Post by Patrickh »

OK, guys I got it. you hit file save on your main form (frmViewer) and it displays a new form that contains the following:
a textbox (txtLocation), next to which is a Browse button (Button1) and under which is a Save button (btnSaveFile).
The code for the Browse button is this:

Code: Select all

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        SaveFileDialog1.Title = "Specify Target Destination"
        SaveFileDialog1.Filter = "JPEG (*.JPG)|*.JPG"
        SaveFileDialog1.FilterIndex = 1

        SaveFileDialog1.OverwritePrompt = True
        If SaveFileDialog1.ShowDialog() <> Windows.Forms.DialogResult.Cancel Then
            txtLocation.Text = SaveFileDialog1.FileName
        End If
    End Sub 
The code for the save button is this:

Code: Select all

Private Sub btnSaveFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaveFile.Click
        frmViewer.picShowPicture.Image.Save("" & txtLocation.Text, System.Drawing.Imaging.ImageFormat.Jpeg)
    End Sub
That lets the user choose the filename and browse for the destination.
Thanks for your help.
Image
conure says: or i could jsut incase my shoes in papar mache, followed by my dog
|||Lethargy||| Mr. Mohawk|||
|||feel free to contact me via PMs, AIM, MSNM, or Xfire if you have any questions|||
Post Reply