 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Lars Guest
|
Posted: Sun Jan 11, 2004 8:34 pm Post subject: StretchBlt quality. |
|
|
Hi,
I use the windows API StretchBlt to resize my images, since it does a far
better job with the HALFTONE attribute opposed to StretchDraw.
However, it's quality is close, but not as good as, a resized image in
Photoshop. I would like to know if anyone knows how Photoshop does the
resizing, or if there is any other approaches to resizing an image to
produce maximum quality for BCB 6.0.
Thanks
|
|
| Back to top |
|
 |
Dennis Jones Guest
|
Posted: Mon Jan 12, 2004 4:11 am Post subject: Re: StretchBlt quality. |
|
|
"Lars" <Lars (AT) MagikaStudios (DOT) com> wrote
| Quote: | Hi,
I use the windows API StretchBlt to resize my images, since it does a far
better job with the HALFTONE attribute opposed to StretchDraw.
However, it's quality is close, but not as good as, a resized image in
Photoshop. I would like to know if anyone knows how Photoshop does the
resizing, or if there is any other approaches to resizing an image to
produce maximum quality for BCB 6.0.
|
That's interesting, because StretchDraw uses StretchBlt internally.
I don't know if this will help you or not, but I wanted a better result from
StretchDraw/StretchBlt some time ago, and after doing a little bit of
research (I'm no graphics expert) found out the following:
StretchBlt uses a "nearest neighbor" algorithm when stretching an image, and
usually results in reasonably good image quality. CopyImage, on the other
hand, uses a "bilinear interpolation" algorithm, and usually results in a
smoother (subjectively speaking) stretched image than StretchBlt. There is
one caveat that I discovered while using CopyImage: it requires that the
image have a 24-bit pixel depth for the interpolation algorithm to work. It
might worth a look.
- Dennis
|
|
| Back to top |
|
 |
Mauro Guest
|
Posted: Fri Jan 16, 2004 3:49 pm Post subject: Re: StretchBlt quality. |
|
|
Lrs,
give me an example with a bitmap (windows API StretchBlt ) that you copy
from image1 to image2 from size 80x80 to 40x40.
Thanks Mauro
"Dennis Jones" <djones (AT) nospam (DOT) com> schrieb im Newsbeitrag
news:40021e55$1 (AT) newsgroups (DOT) borland.com...
| Quote: |
"Lars" <Lars (AT) MagikaStudios (DOT) com> wrote in message
news:4001b3d6 (AT) newsgroups (DOT) borland.com...
Hi,
I use the windows API StretchBlt to resize my images, since it does a
far
better job with the HALFTONE attribute opposed to StretchDraw.
However, it's quality is close, but not as good as, a resized image in
Photoshop. I would like to know if anyone knows how Photoshop does the
resizing, or if there is any other approaches to resizing an image to
produce maximum quality for BCB 6.0.
That's interesting, because StretchDraw uses StretchBlt internally.
I don't know if this will help you or not, but I wanted a better result
from
StretchDraw/StretchBlt some time ago, and after doing a little bit of
research (I'm no graphics expert) found out the following:
StretchBlt uses a "nearest neighbor" algorithm when stretching an image,
and
usually results in reasonably good image quality. CopyImage, on the other
hand, uses a "bilinear interpolation" algorithm, and usually results in a
smoother (subjectively speaking) stretched image than StretchBlt. There
is
one caveat that I discovered while using CopyImage: it requires that the
image have a 24-bit pixel depth for the interpolation algorithm to work.
It
might worth a look.
- Dennis
|
|
|
| Back to top |
|
 |
Winter Guest
|
Posted: Fri Jan 16, 2004 4:30 pm Post subject: Re: StretchBlt quality. |
|
|
SetStretchBltMode(Image1->Picture->Bitmap->Canvas->Handle,HALFTONE);
StretchBlt(Image2->Picture->Bitmap->Canvas->Handle,0,0,40,40,Image1->Picture
->Bitmap->Canvas->Handle,0,0,Image1->Picture->Bitmap->Width,Image1->Picture-
| Quote: | Bitmap->Height,SRCCOPY);
|
The key here is to set the HALFTONE first, this will make the image look
alot better.
Hope this helps.
Lars
|
|
| Back to top |
|
 |
Mauro Guest
|
Posted: Mon Jan 19, 2004 6:37 am Post subject: Re: StretchBlt quality. |
|
|
Thanks Lars,
it is better, but have a look on the Damon's coding,
the resized pictures look great!
Regards,
Mauro
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|