Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.basic.visual.misc > #2432
| From | "Mayayana" <mayayana@invalid.nospam> |
|---|---|
| Newsgroups | comp.lang.basic.visual.misc, microsoft.public.vb.general.discussion |
| Subject | Re: VB6 Image Resizer |
| Date | 2020-03-29 15:36 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <r5qtcc$cec$1@dont-email.me> (permalink) |
| References | (2 earlier) <20200328171731.0000601c@eternal-september.org> <r5o5tf$pbi$1@dont-email.me> <20200329154826.00007a8d@eternal-september.org> <r5qm0a$lne$1@dont-email.me> <r5qnc4$1b2$1@dont-email.me> |
Cross-posted to 2 groups.
"GS" <gs@v.invalid> wrote
| Need way to do the following:
| 2. Determine orientation by examine w/h max to get new width;
| This will be 480 if portrait, 640 if landscape.
| Aspect ratio will auto-set height.
|
| 3. Save the pic file by overwriting existing;
|
Here's my image class:
https://www.jsware.net/Files2/imclass.zip
The code works like this:
Dim oPic As StdPicture
Dim ImOb As cImage, ImOb2 As cImage
Set oPic = LoadPicture(sPathSrc)
If (Err.Number = 0) Then
Set ImOb = New cImage
LRet = ImOb.CopyStdPicture(oPic)
'-------
sPathSrc is the path of the image file. So you
load a BMP/JPG/GIF into a StdPicture and then
copy that into the class. From there all sorts of
operations can be done, including resizing, cropping,
etc. and writing a new imahe to disk as BMP or JPG.
These were the most efficient methods I found.
There's also
https://www.jsware.net/Files2/resizetest.zip
That demonstrates that GDI+ resizing is faster than
VB methods using an Image control, with much
better picture quality. It's also slightly better
than WIA in terms of both speed and quality.
For sheer speed with large images I found jpegturbo
was the fastest resizer, by using the closest size
among the 8 (?) presets, then resizing that as needed.
Going from very big down to small is what takes so
much time.
Of course, none of this will handle PNG or TIF.
You'll need external libraries for that. I have code
for rendering PNG in VB, but not for saving as PNG.
And it's slow, anyway.
Back to comp.lang.basic.visual.misc | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
VB6 Image Resizer GS <gs@v.invalid> - 2020-03-28 00:26 -0400
Re: VB6 Image Resizer "Mayayana" <mayayana@invalid.nospam> - 2020-03-28 10:04 -0400
Re: VB6 Image Resizer Arne Saknussemm <es215.10.wannabet@spamgourmet.com> - 2020-03-28 17:17 +0100
Re: VB6 Image Resizer "Mayayana" <mayayana@invalid.nospam> - 2020-03-28 14:12 -0400
Re: VB6 Image Resizer "Mayayana" <mayayana@invalid.nospam> - 2020-03-28 14:43 -0400
Re: VB6 Image Resizer Arne Saknussemm <es215.10.wannabet@spamgourmet.com> - 2020-03-29 15:48 +0200
Re: VB6 Image Resizer "Mayayana" <mayayana@invalid.nospam> - 2020-03-29 10:41 -0400
Re: VB6 Image Resizer GS <gs@v.invalid> - 2020-03-29 13:30 -0400
Re: VB6 Image Resizer GS <gs@v.invalid> - 2020-03-29 13:54 -0400
Re: VB6 Image Resizer "Mayayana" <mayayana@invalid.nospam> - 2020-03-29 15:36 -0400
Re: VB6 Image Resizer GS <gs@v.invalid> - 2020-03-29 16:19 -0400
Re: VB6 Image Resizer "Mayayana" <mayayana@invalid.nospam> - 2020-03-29 18:40 -0400
Re: VB6 Image Resizer GS <gs@v.invalid> - 2020-03-29 18:49 -0400
Re: VB6 Image Resizer "Mayayana" <mayayana@invalid.nospam> - 2020-03-29 23:17 -0400
Re: VB6 Image Resizer GS <gs@v.invalid> - 2020-03-30 07:44 -0400
Re: VB6 Image Resizer "Mayayana" <mayayana@invalid.nospam> - 2020-03-30 09:52 -0400
Re: VB6 Image Resizer GS <gs@v.invalid> - 2020-03-30 12:37 -0400
Re: VB6 Image Resizer GS <gs@v.invalid> - 2020-03-30 13:35 -0400
Re: VB6 Image Resizer GS <gs@v.invalid> - 2020-03-28 14:59 -0400
Re: VB6 Image Resizer "Mayayana" <mayayana@invalid.nospam> - 2020-03-28 16:39 -0400
Re: VB6 Image Resizer GS <gs@v.invalid> - 2020-03-28 17:57 -0400
Re: VB6 Image Resizer GS <gs@v.invalid> - 2020-03-28 18:44 -0400
Re: VB6 Image Resizer "Mayayana" <mayayana@invalid.nospam> - 2020-03-28 22:49 -0400
Re: VB6 Image Resizer GS <gs@v.invalid> - 2020-03-29 13:22 -0400
Re: VB6 Image Resizer "Peter T" <askmy@email.com> - 2020-03-30 17:29 +0100
Re: VB6 Image Resizer GS <gs@v.invalid> - 2020-03-30 12:34 -0400
Re: VB6 Image Resizer "Peter T" <askmy@email.com> - 2020-03-31 10:59 +0100
Re: VB6 Image Resizer GS <gs@v.invalid> - 2020-03-31 09:43 -0400
Re: VB6 Image Resizer GS <gs@v.invalid> - 2020-03-31 12:53 -0400
Re: VB6 Image Resizer "Mayayana" <mayayana@invalid.nospam> - 2020-03-30 18:20 -0400
Re: VB6 Image Resizer GS <gs@v.invalid> - 2020-03-30 18:50 -0400
Re: VB6 Image Resizer GS <gs@v.invalid> - 2020-03-30 18:56 -0400
Re: VB6 Image Resizer "Mayayana" <mayayana@invalid.nospam> - 2020-03-30 21:24 -0400
Re: VB6 Image Resizer GS <gs@v.invalid> - 2020-03-30 21:30 -0400
Re: VB6 Image Resizer "Mayayana" <mayayana@invalid.nospam> - 2020-03-30 22:01 -0400
Re: VB6 Image Resizer GS <gs@v.invalid> - 2020-03-30 22:11 -0400
Re: VB6 Image Resizer "Mayayana" <mayayana@invalid.nospam> - 2020-03-31 17:41 -0400
Re: VB6 Image Resizer GS <gs@v.invalid> - 2020-03-31 17:51 -0400
Re: VB6 Image Resizer "Mayayana" <mayayana@invalid.nospam> - 2020-03-31 21:08 -0400
Re: VB6 Image Resizer GS <gs@v.invalid> - 2020-03-31 21:14 -0400
csiph-web