Shell "convert pict.png -resize 100x100 /tmp/pict.png" Wait
Resize a picture
- cogier
- Site Admin
- Posts: 1125
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Resize a picture
Can anybody tell me how to resize a picture without using a Shell command?
Re: Resize a picture
picturebox with stretch = true ???
otherwise ... the image class has a function called stretch
otherwise ... the image class has a function called stretch
- cogier
- Site Admin
- Posts: 1125
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Resize a picture
I am aware of 'Stretch'. Much better to use Mode than stretch.
What I am doing gets a picture to line up with a GridView when being dragged. Below you can see it works. This allows me to resize the form and the image still lines up, so it needs to be exact. So sorry, 'Stretch' doesn't cut it!
What I am doing gets a picture to line up with a GridView when being dragged. Below you can see it works. This allows me to resize the form and the image still lines up, so it needs to be exact. So sorry, 'Stretch' doesn't cut it!
Re: Resize a picture
Does this "stretch" work for you? It seems to do what your shell command intends. (I just noticed PJBlack's second line, so here is an example.)
Ced
Ced
'=============================================================================
Public Sub Main()
Dim P As Image = Image.Load("~/Pictures/Wallpaper1920/DogOnDock.JPG")
Dim I As Image = P.Stretch(200, 200)
I.Save("DoD.jpg")
End
'=============================================================================
.... and carry a big stick!
- BruceSteers
- Posts: 1574
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Resize a picture
Image.Stretch
Dim hPic as Picture = Picture.Load(sMyPic) ' original size
Dim hPicStretched As Picture = hPic.Image.Stretch(100,100).Picture ' resized picture
If at first you don't succeed , try doing something differently.
BruceS
BruceS
- cogier
- Site Admin
- Posts: 1125
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Resize a picture
Opps, sorry PJBlack. You were right, as is everybody else as well. It works like a charm.
Reminder, I must read posts more carefully!
Reminder, I must read posts more carefully!