Home > Software engineering >  After screenshots, how to obtain image data from the system clipboard, and generate a JPG file
After screenshots, how to obtain image data from the system clipboard, and generate a JPG file

Time:11-02

After screenshots, how to use the image data was obtained from the system clipboard, and generate a JPG file

Look forward to, Posting for the first time, what is not clear, contains a lot,
It is best to VBS,

CodePudding user response:

 Private Sub Command1_Click () 
Dim PIC As New StdPicture
The Set PIC=Clipboard. GetData
SavePicture PIC, App. Path & amp; "\ PIC. JPG"
End Sub


Using VB to Clipboard object can be achieved

CodePudding user response:

How to realize the screenshots, the building Lord could you tell me

CodePudding user response:

What do you mean with the printScreen key after screenshots, display in your program, and then export the JPG?

CodePudding user response:

Dim PIC As New StdPicture
The Set PIC=Clipboard. GetData

CodePudding user response:

To save into JPG format, you need a special BMP - & gt; JPG conversion program

CodePudding user response:

reference 1st floor lex4271656 response:
 Private Sub Command1_Click () 
Dim PIC As New StdPicture
The Set PIC=Clipboard. GetData
SavePicture PIC, App. Path & amp; "\ PIC. JPG"
End Sub


Using VB to Clipboard object can implement


This is just the bitmap data!
You use the JPG to save the file extensions, it seems to be JPG images on the surface, but in fact it is still a BMP images,

As 5 f says, but also the process of BMP to JPEG do,

CodePudding user response:

Dim PIC As StdPicture 'don't need a new
The Set PIC=Clipboard. GetData

CodePudding user response:

 Private Sub Command1_Click () 
Dim PIC As New StdPicture
The Set PIC=Clipboard. GetData
SavePicture PIC, App. Path & amp; "\ PIC. BMP"
Shell "alchemy. Exe - j" + App. Path + "\ PIC. BMP" + App. Path + "\ PIC. JPG", vbHide
End Sub

http://www.handmade.com

CodePudding user response:

Other people's computer have no alchemy. Exe this file, your code can run?
  •  Tags:  
  • VBA
  • Related