Home > Software engineering >  Vb6 how in picture1 paste in the location and area of the picture?
Vb6 how in picture1 paste in the location and area of the picture?

Time:09-20

Vb6 how in picture1 paste in the location and area of the picture?
(can be improved using. Picture=Clipboard. "GetData" and does not affect the original image on the picture1?)
I run a picture1. Picture=Clipboard. GetData, original painting figure all gone on the picture1. How regional paste?

CodePudding user response:

Picture1. PaintPicture......

CodePudding user response:

In any position drawings


Use PaintPicture method, can be in the form, picture box and Printer anywhere on the object, drawing graphics, PaintPicture method syntax is:

[object] PaintPicture PIC, destX destY [destWidth [destHeight [, srcX _

[srcY [, srcWidth, srcHeight [[, Op]]]]]]]

Target object refers to the form, the Picture box or Printer objects, these places are premises of PIC image performance, if the object is ignored, argues that the specified is the current form, the PIC parameter must be an object images, it is decided by the Picture form or control properties,

DestX and destY parameters, it is according to the objec ScaleMode, the image will appear in the horizontal and vertical position, destWidth and destHeight parameter is optional and is used to set width and height of the image in the target object,

SrcX and srcY parameters are optional, used to define the top left corner of the PIC in the cutting area x and y coordinates,

Optional Op parameters used to define when drawing on the target object, AND perform on the image of the raster operation (for example, the AND AND XOR),

PaintPicture method can replace the BitBlt Windows API functions, the rectangular graphics block any move from one place to another place, it can perform a wide range of various operations,

For example, you can use PaintPicture method to generate multiple copies of the same type of bitmap, and put them flat out on the form, using this method, faster than moving images controls in the form, the following code is used for tile image control of 100 copies, and through setting a negative value to destWidth, can make each image to flip horizontal,

For I=0 To 10
For j=0 To 10
Form1. PaintPicture picF. Picture, j * _
PicF. Width, I * picF. Height, _
PicF. - picF. Height Width,
Next j, I

Details please refer to the "language reference" PaintPicture method ", "
  • Related