Picture resizing

Post your Gambas programming questions here.
Post Reply
User avatar
cogier
Site Admin
Posts: 1127
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Picture resizing

Post by cogier »

My camera produces up to 10Meg photos. I have discovered that FileChooser refuses to display a preview of large images. I can get the image into a PictureBox, but if I want to display many at once, the amount of memory used can cause my PC to lock up! If I reduce the size of the photos to less than a Meg everything is fine.

Image

Is there a way to reduce the picture inside a PictureBox without having to reduce the original photo? The Picture.Resize() cuts the picture which is not what I am looking for.

Unrelated discovery: -

In a post on this site If you wrap an image with a link, the image become clickable. Try clicking the image above.

Code: Select all

[url=http://link][img]http://MyPicture[/img][/url]
User avatar
BruceSteers
Posts: 1578
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Picture resizing

Post by BruceSteers »

I got Benoit to add a FileView.MaxPreviewSize property
http://gambaswiki.org/wiki/comp/gb.form ... reviewsize

Either set max size manually.

Or set to zero to use the default 4mb that used to be the only max size before I moaned about it 🙄

Set it to -1 for unlimited size .

  FileChooser1.FileView.MaxPreviewSize = -1
If at first you don't succeed , try doing something differently.
BruceS
User avatar
cogier
Site Admin
Posts: 1127
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Picture resizing

Post by cogier »

Thanks Bruce. I'll check this out tomorrow.

EDIT 20/08/2023

That's done it! Thanks. :D
User avatar
BruceSteers
Posts: 1578
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Picture resizing

Post by BruceSteers »

cogier wrote: Saturday 19th August 2023 8:02pm Thanks Bruce. I'll check this out tomorrow.

EDIT 20/08/2023

That's done it! Thanks. :D
No worries.
I had the same problem once.

Benoit is pretty cool though when it comes to suggesting good ideas.
After adding this he has made a few more updates to fileview to improve previewing.

8-)
If at first you don't succeed , try doing something differently.
BruceS
Post Reply