Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21839

.Picture = .Picture vs PaintPicture using EMF image

$
0
0
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?

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

Is there a way to enlarge a picture without getting the flicker?

Viewing all articles
Browse latest Browse all 21839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>