 |
rusdyrip Level: Trainee
 Registered: 22-11-2004 Posts: 3
|
Image Zoom problem
hi, I write script to zoom in and zoom out an image, but the image pixel is very poor if I enlarge the picture.
i try windows xp image viewer is very good the image pixel is very smooth
Is there any why to solve this problem?
pls help! thx
|
|
22-11-2004 at 04:52 PM |
|
|
Goran Level: Moderator
 Registered: 16-05-2002 Posts: 1681
|
Re: Image Zoom problem
You say
quote: hi, I write script to zoom in and zoom out an image, but the image pixel is very poor if I enlarge the picture
but you dont say what code are you using to zoom picture.
____________________________
If you find the answer helpful, please mark this topic as solved.
|
|
22-11-2004 at 11:30 PM |
|
|
rusdyrip Level: Trainee
 Registered: 22-11-2004 Posts: 3
|
Re: Image Zoom problem
Dim Zoom As Boolean, iHgtMin As Single, iWdhMin As Single
Private Sub DoZoom(index As Integer)
Do
Image1.Visible = False
Select Case index
'Enlarging
Case 0
Image1.Top = Image1.Top - (Image1.Height * 0.025)
Image1.Left = Image1.Left - (Image1.Width * 0.025)
Image1.Height = Image1.Height + (Image1.Height * 0.05)
Image1.Width = Image1.Width + (Image1.Width * 0.05)
'Shrinking
Case 1
If Image1.Height <= 25 Or Image1.Width <= 25 Then
Image1.Visible = True
Zoom = False
Exit Sub
End If
Image1.Top = Image1.Top + (Image1.Height * 0.025)
Image1.Left = Image1.Left + (Image1.Width * 0.025)
Image1.Height = Image1.Height - (Image1.Height * 0.05)
Image1.Width = Image1.Width - (Image1.Width * 0.05)
End Select
Image1.Visible = True
DoEvents
If Not Zoom Then Exit Do
Loop
End Sub
Private Sub Command1_MouseDown(index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Zoom = True
DoZoom index
End Sub
Private Sub Command1_MouseUp(index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Zoom = False
End Sub
Private Sub Form_Load()
Image1.Stretch = True
iWdhMin = Image1.Width / 4
iHgtMin = Image1.Height / 4
End Sub
sory i forgot ,this my code
thx for reply
|
|
23-11-2004 at 02:12 AM |
|
|
Goran Level: Moderator
 Registered: 16-05-2002 Posts: 1681
|
Re: Image Zoom problem
It seems that I have missed this code you have post. If you didnt find any solution so far, then you might try with using PictureBox control and PaintPicture method, it can be used for 'zooming'. There are also some algorithms that deal with improving picture quality as much as possible, so if you still have poor zoom performance, you would need to find some book about bitmap algorithms, and use this algorithms to try to improve it. Zooming has it boundaries, and if picture is of low quality, then you cant do much about it.
____________________________
If you find the answer helpful, please mark this topic as solved.
|
|
15-12-2004 at 03:41 PM |
|
|
|
|
 |
 |