I load an EMF image into Picture1. If I resize Picture1 the image grows as I make Picture1 larger. The problem is it has an annoying flicker about it.
So I put Picture2 on the Form and make Picture1.Visible = False. As I resize Picture1 I use Picture2.Picture = Picture1.Picture and the resized picture now shows in Picture2. But the flickering still shows.
So instead of using .Picture = .Picture I use Picture2.PaintPicture. It appears that the flickering has been greatly reduced but the problem here is even though the picture in Picture1 gets bigger when I copy it over to Picture2 it is the original size of Picture1
Why does this occur with PaintPicture but not with Picture = Picture?
Is there a way to enlarge a picture without getting the flicker?
So I put Picture2 on the Form and make Picture1.Visible = False. As I resize Picture1 I use Picture2.Picture = Picture1.Picture and the resized picture now shows in Picture2. But the flickering still shows.
So instead of using .Picture = .Picture I use Picture2.PaintPicture. It appears that the flickering has been greatly reduced but the problem here is even though the picture in Picture1 gets bigger when I copy it over to Picture2 it is the original size of Picture1
Why does this occur with PaintPicture but not with Picture = Picture?
Code:
Private Sub Command2_Click()
Picture1.Width = Picture1.Width + 10
Picture1.Height = Picture1.Height + 10
Picture2.Width = Picture2.Width + 10
Picture2.Height = Picture2.Height + 10
Picture2.PaintPicture Picture1.Picture, 0, 0, Picture1.Width, Picture1.Height, 0, 0, Picture2.Width, Picture2.Height
End Sub