VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Use PictureBox, Image Control to save images in a directory

by Bhuwan Chand Joshi (69 Submissions)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 21st July 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Use PictureBox, Image Control to save images in a directory

Rate Use PictureBox, Image Control to save images in a directory



'Open a standard exe form.
 
'Place a PictureBox control over the form

'Put a Two Command Button over the form

'Change the Caption property of the Command Buttons as LoadImage and SaveImage

'Write the code given below in the Click event of Command Button

'First click the LoadImage button to load the image and then Click SaveImage to save the Image.

Private Sub Command1_Click() 

Picture1.Picture=LoadPicture("Path of the BMP File")

End Sub

Private Sub Command2_Click()

SavePicture Picture1, "Path where you need to save the image Loaded into the picture box "

End Sub


'Open a standard exe form
 
'Place a Image control over the form

'Put a Two Command Button over the form

'Change the Caption property of the Command Buttons as LoadImage and SaveImage

'Write the code given below in the Click event of Command Button

'First click the LoadImage button to load the image and then Click SaveImage to save the Image.

Private Sub Command1_Click() 

Image1.Picture=LoadPicture("Path of the BMP File")

End Sub

Private Sub Command2_Click()

SavePicture Image1, "Path where you need to save the image Loaded into the picture box "

End Sub



'Example 

'Load Picture into the PictureBox Control 

'Load the picture Old.bmp in the PictureBox Control

Private Sub Command1_Click()

Picture1.Picture=LoadPicture("D:\Old.bmp")

End Sub 

'Save Picture into the Specified Directory with the new name 

Private Sub Command2_Click()

SavePicture Picture1,"D:\New.bmp" 

End Sub 

'Now the directory consists of same images with two different names Old.bmp and New.bmp 

'You can use the utility to save images in your system anywhere using Picture controls.



Download this snippet    Add to My Saved Code

Use PictureBox, Image Control to save images in a directory Comments

No comments have been posted about Use PictureBox, Image Control to save images in a directory. Why not be the first to post a comment about Use PictureBox, Image Control to save images in a directory.

Post your comment

Subject:
Message:
0/1000 characters