Home > Software engineering >  The add method can only use LoadPicture loading ImageList?
The add method can only use LoadPicture loading ImageList?

Time:12-01

So, I have a control can generate qr code image, use the Picture1. Picture=QRmaker1. Picture, switch will be flashing phenomenon, so I want to have all of the generated QRmaker1. Picture added to the ImageList, but when I wrote ImageList1. ListImages. Add, QRmaker1. The Picture will be prompted to invalid operation Picture, how can I solve this problem?

CodePudding user response:

Only supports BMP, ico, JPG
See your qr code generated is what format, met several people take it for granted before the pictures with the save method saved as JPG or BMP extension, but it is PNG format, with UE such as binary editor to open the file to see the head, what is the format of the file,

CodePudding user response:

1. Solve the problem of "flash", the original poster can try:
 Picture1. AutoRedraw=True 
'design when setting this property in the form, or written in the Form_Load (),


2. Solve the problem of invalid "Picture", the original poster can try to use "objects" to transfer the no,
 Dim objImg As IPictureDisp 

The Set objImg=QRmaker1. Picture
ImageList1. ListImages. Add,, objImg
  • Related