A voir également:
- Visualisez cette image avec un logiciel d'édition d'images. combien y a-t-il de pixels noirs sur le camion ? votre réponse nombre de pixels noirs :
- Combien y a-t-il de bateaux dans la zone de 475 pixels de large et 1000 pixels de haut à partir du coin supérieur gauche de cette image ? - Guide
- Logiciel de sauvegarde gratuit - Guide
- Money logiciel - Télécharger - Comptabilité & Facturation
- Image iso - Guide
- Logiciel - Guide
2 réponses
Bonjour,
un exemple à adapter:
Sub redimensionner() Set oSheet = ThisWorkbook.Worksheets(1) Set oShape = oSheet.Shapes("Image 2") 'a adapter oShape.Width = "1000" oShape.Height = "1000" oShape.LockAspectRatio = msoFalse End Sub Sub dimension() MsgBox ActiveSheet.Shapes("Image 2").Width & "x" & ActiveSheet.Shapes("Image 2").Height End Sub
Bonjour,
Merci pour la réponse !
Cela redimensionne effectivement la photo, mais lorsque je fais ensuite clique droit, enregistrer l'image, le fichier enregistré fait plus que 1000x1000 (photo jointe).
Essaie ceci:
Sub save() Application.ScreenUpdating = False For i = 1 To 4 ExportImage ("Image " & i) Next i Application.ScreenUpdating = True retablir MsgBox "Terminer" End Sub Sub ExportImage(ByVal image As String) répertoire = ThisWorkbook.path Set f = ActiveSheet nomshape = image Set img = f.Shapes(nomshape) img.Width = "1850" img.Height = "1850" img.LockAspectRatio = msoFalse img.CopyPicture xlScreen, xlBitmap With img.Parent.ChartObjects.Add(0, 0, img.Width, img.Height).Chart While .Shapes.Count = 0 DoEvents .Paste Wend .Export nomshape & ".jpg", "jpg" .Parent.Delete End With End Sub Sub retablir() Dim sh As Shape For Each sh In ActiveSheet.Shapes sh.ScaleHeight 1, msoTrue sh.ScaleWidth 1, msoTrue Next sh End Sub
Voilà
@+Le Pivert