VB6-Microsoft Picture clip Control

Source: Internet
Author: User

When we encounter a dual-sided scanner during image processing in the hospital, we need to divide the two scanned images into one and print them. In the process of image segmentation, there is always no way to do this. Although cbm666 was provided later, it was not very convenient. When I Accidentally flipped through a VB book, I saw an example using the Microsoft Picture clip control. It was super easy to split the image. Share the following code to make sure you can use it.

 

'Reference the Microsoft Picture clip control and place it named pic1
'Split 009.jpg vertically into 2 parts and save it to the local tmp1 tmp2
Pic1.picture = loadpicture (App. Path + "\ 009.jpg ")
Pic1.cols = 2
Pic1.rows = 1

Picture1 (0). Picture = pic1.graphiccell (0)
Picture1 (1). Picture = pic1.graphiccell (1)

'The Image saved in this way is a bitmap, which will be very large.
Savepicture picture1 (0). Picture, app. Path + "\ tmp1.jpg"
Savepicture picture1 (1). Picture, app. Path + "\ tmp2.jpg"


'You can use the following picbuf controls for image compression and storage, and you need to register the ik32.ocx Control
'You can also leave the image to picturebox without saving it.
Pica. Picture = pic1.graphiccell (0)
Picb. Picture = pic1.graphiccell (1)

CallSavepic (PICA, "tmp1 ")
CallSavepic (picb, "tmp2 ")

Private SubSavepic (ByvalControlAsPicbuf,ByvalFilenameAs String)

Control. imageformat = ik_jpeg
Control. writecompression = 85
Control. filename = app. Path + "\" + filename + ". jpg"
Control. Store

End Sub

The cbm666 method for separating large images is provided, but the preceding controls are not flexible and convenient:

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.