A complete patterning method is provided in VB, you can draw a variety of graphics in the form or graphics box, which provides a convenient image processing command that is: PAINTPICTURE, this command is similar to the Windows API function bitblt, but due to Don't do the API function description, and have its unique features, so more convenience, use it to complete a special processing of many images. I. Syntax format: PaintPicture Pic, Destx, Desty, Destwidth, DestHeight, Scrx, Scry, Scrwidth, Scrheight where PIC: For image objects such as graphics box Picture, DESTX, DESTY: Target image location; DestWidth, Destheight: Target Image Size; SCRX, SCRY: Cutting coordinates of the original image; ScrWidth, Scrheight: The original image is cropped; it can be seen from the above format that the function of this command is to copy one source image resource to the specified area and by changing the parameters. DestWidth and DestHEIGHT values, you can also change the size of the replicated image, enlarged or narrow the image display, and can even set these two attributes as a negative value, so that the target image is flipped in the horizontal direction, achieving special effects image display. Program example: (by griefforyou) Add two PictureBox in the form, two CommandButton, where Picture1 loads an image
Add the following code to the form module: Private submmand1_click () Picture2.PaintPicture Picture1.Picture, Picture1.ScaleWidth, 0, Picture1.scaleWidth, Picture1.scaleHeightenD Sub
Private submmand2_click () Picture2.paintPicture Picture1.picture, 0, Picture1.scaleHeight, Picture1.scaleWidth, -Picture1.scaleHeightenD Sub runs as follows: