Auteur de questions
zoom sur un form avec des buttons et des draw.line

Discussion générale
-
bonjour
plus d'un mois que je cherche a zoummer avec un rectangle de selection une region de ma form,
les draw.line repond a l'evenement mais les controles restent intatc. merci
- Type modifié Alex Petrescu mardi 15 mars 2011 11:43
Toutes les réponses
-
Bonjour,
Pouvez-vous nous fournir votre code actuel pour que l'on puisse se baser dessus afin de vous aider ?
Aussi, pouvez-vous préciser quel(s) contrôle(s) seraient destinés à être zoomés ?
Bonne journée
N'hésitez pas à poser des questions si un problème subsiste ou quelque chose n'est pas clair. Dans l'autre cas, veuillez indiquer que le problème est résolu. Cordialement. - Best Regards. -
Bonjour,
Si j'ai bien compris, vous essayez de reproduire la loupe de Windows (Démarrer - Programmes - Accessoires - accessibilité - loupe) ?
J'ai trouvé un exemple en C Sharp sur
http://www.codeproject.com/KB/cs/SimpleMagnifier.aspx
fred -
Bonjour,
Ammadi Abdelaziz, si ce problème est toujours d’actualité, je vous remercie de nous tenir au courant avec l’état de votre projet.
Cordialement,
Alex
________________
Astuces pour Visual Studio 2010
XNA – Développement jeux vidéo
Didacticiels et astuces : VB.NET, C#, ASP.NET, .NET Framework, Silverlight, Workflow Foundation, SharePoint, WPF
Microsoft propose ce service gratuitement, dans le but d'aider les utilisateurs et d'élargir les connaissances générales liées aux produits et technologies Microsoft. Ce contenu est fourni "tel quel" et il n'implique aucune responsabilité de la part de Microsoft.
-
bonjour tout le monde je m'excuse pour ce ratard
pour le code est simple il suffit de tracer une ligne par exemple par la commande
e.graphic.drawline(brush1,25,25,500,500) et tu met a cote un button et tu zuomme tout
j'ai pas arriver a zoummer sur le formulaire
j'ai trouver une solution mais pas satisffesante
la solution est copier l'image et par la suite tu fait appel a l'image et zoumme comme tu veut
Private Sub ZoomToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ZoomToolStripMenuItem.Click
GroupBox1.Visible = False
Try
If cropWidth < 1 Then
'if there are not proper cropping cordinates, then throw a message and exit code
MessageBox.Show("selctionnerd'abord.", " No cropping Cordinates!", MessageBoxButtons.OK, MessageBoxIcon.Error)
Exit Sub
End If
'a rectangle to set the location and size from the source image
Dim rect As Rectangle = New Rectangle(cropX, cropY, cropWidth, cropHeight)
Dim bit As Bitmap = New Bitmap(BackgroundImage, Width, Height)
'create a new bitmap with the width/height values that were specified in the textboxes.
cropBitmap = New Bitmap(cropWidth, cropHeight)
'a new Graphics object that will draw on the cropBitmap
Dim g As Graphics = Graphics.FromImage(cropBitmap)
'draw the portion of the image that you supplied cropping values for.
g.DrawImage(bit, 0, 0, rect, GraphicsUnit.Pixel)
' PictureBox1.BackgroundImage = Nothing
BackgroundImage = cropBitmap
Dock = DockStyle.Left
' PictureBox2.Width = 1160
' PictureBox2.Height = 750
' Top = 50
'Left = 0
Catch exc As Exception
MessageBox.Show(exc.Message, " Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
' Dim ctl As Control
' 'MsgBox(Label1.Left)
' Dim str As String
'For Each ctl In Me.Controls
'Str = ctl.GetType.ToString
'If Str() = "System.Windows.Forms.Label" Then
'' If Ctl.Left > cropX And Ctl.Right < cropX + cropWidth And Ctl.Top > cropY And Ctl.Bottom < cropY + cropHeight Then
' ctl.Width = (ctl.Width * (ClientSize.Width)) / cropWidth
'ctl.Height = (ctl.Height * (ClientSize.Height)) / cropHeight
' ctl.Left = (ClientSize.Width / cropWidth) * (ctl.Left - cropX)
'ctl.Top = (ClientSize.Height / cropHeight) * (ctl.Top - cropY)
'MsgBox(Label1.Left)
' End If
' MsgBox(Ctl.Name)
'ctl.AutoSize = False
' ctl.BackColor = System.Drawing.Color.White
'ctl.Font = New System.Drawing.Font("Microsoft Sans Serif", i * 15.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
'ctl.Font = New System.Drawing.Font("Microsoft Sans Serif", 20.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
'i = i * 2
'End If
'Next
'ctl.AutoSize = True
End Sub