How to zoom pictures on WM2003 and WM5.0

Dear Sir,

I would like to develop an application on windows mobile 2003 and 5.0 of the following features:

1, The camera shot a picture and display it on the mobile device’s screen.

2, Since the resolution of the device’s screen is usually much poorer than the picture, users would like to zoom it. The scenario could be designed as following: there are a small circle on the snapshot of the picture. Users are capable of moving it via keys. When selected, the screen display the zoomed portion of the picture.

I am a beginner of windows mobile developer, I am not acquaintance with the resources of windows mobile sdk and .net compact frame work. I could you tell me how to realize the above effect as well as the resources and architecture I should involve. I have some experience of VS2005/C# and SQL 2005.

would you please reply to jademobile@126.com



Answer this question

How to zoom pictures on WM2003 and WM5.0

  • James Bannan

    Thank u very much.

    B.T.W: Is it possible to writte them in C#.net 2.0


  • Peter Peng

    Hi,

    not tried it but http://msdn.microsoft.com/msdnmag/issues/04/08/EndBracket/ looks helpful

    Pete


  • Ronald#2

    The routines below handle zooming etc.

    Screen Width etc

    Dim theScreen As Rectangle
    theScreen = Screen.PrimaryScreen.Bounds()


    Fit to Screen

    Me.PictureBox1.Width = thescreen.width
    Me.PictureBox1.Height = theScreen.height
    Me.vScrollBar1.Visible = False
    Me.hScrollBar1.Visible = False
    Me.PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage


    Show normal

    Me.vScrollBar1.Visible = True
    Me.hScrollBar1.Visible = True
    Me.PictureBox1.SizeMode = PictureBoxSizeMode.Normal
    Me.PictureBox1.Refresh()


    Zoom In/Out

    ...
    Case 3 ' + Zoom In
    PictureBox1.Width = PictureBox1.Width + (PictureBox1.Width * 0.1)
    PictureBox1.Height = PictureBox1.Height + (PictureBox1.Height * 0.1)
    ReShow_Image()
    Case 4 ' - Zoom Out
    PictureBox1.Width = PictureBox1.Width - (PictureBox1.Width * 0.1)
    PictureBox1.Height = PictureBox1.Height - (PictureBox1.Height * 0.1)
    ReShow_Image()
    ...

    Public Sub ReShow_Image()
    Me.PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
    If PictureBox1.Width >= theScreen.width Or PictureBox1.Height >= thscreen.height Then
    Me.vScrollBar1.Maximum = Me.PictureBox1.Height + Me.hScrollBar1.Height
    Me.hScrollBar1.Maximum = Me.PictureBox1.Width + Me.vScrollBar1.Width
    Me.panel1.Size = Me.PictureBox1.Size
    Me.hScrollBar1.Value = 0
    Me.vScrollBar1.Visible = True
    Me.hScrollBar1.Visible = True
    Else
    Me.vScrollBar1.Visible = False
    Me.hScrollBar1.Visible = False
    End If
    PictureBox1.Refresh()
    End Sub


    Panning

    Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
    bDragging = True
    sx = e.X
    sy = e.Y
    End Sub

    Private Sub PictureBox1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseUp
    bDragging = False

    End Sub

    Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove

    If bDragging Then
    With PictureBox1
    nx = .Left - sx + e.X
    ny = .Top - sy + e.Y
    .Location = New System.Drawing.Point(nx, ny)
    End With
    End If

    End Sub


    HTH

    Pete


  • How to zoom pictures on WM2003 and WM5.0