Re: Sharpen an Image File



I've been using GDI+ now for a few months so I can have my way with images,
and it is an excellent solution...and yes, if not used properly, things can
backfire. GDI+ calls need a few levels of init, and each level needs to be
released...but once it's running you can do great things with it.

Oh yeah, the kicker...one must include the GDI "runtime" and install it into
the local folder (and not install it on XP). The file is a little over 1
MB.

Is it worth it? Well, you decide. :)

- Kev


"Mike D Sutton" <EDais@xxxxxxxx> wrote in message
news:ufaow3FXFHA.628@xxxxxxxxxxxxxxxxxxxxxxx
>> I have an image file that I am stretching proportionately (height and
>> width), but the result is a slightly blurred image. Is there any APIs I
>> can
>> use that would somehow sharpen the image or anti-alias it slightly.
>>
>> Yours more in hope than expectation! Thanks again for the support of the
>> group.
>
> AFAIK there is something in GDI+ but people seem to have a great deal of
> problems using it from the number of posts
> about it on the GDI groups, so your alternative is to write the filter
> yourself - Have a look at the "Edge detection /
> Edge snap / Filter kernel" demo on my site which includes a generic filter
> kernel class that can be set to a sharpen
> matrix. The SetSharpen() method of the class set's this kernel up for you
> and looks something like this:
>
> -1 -1 -1
> -1 9 -1
> -1 -1 -1
>
> The centre weight must be one higher than the sum of the surrounding
> values (otherwise you end up with an edge-detection
> kernel rather than an edge enhancement kernel), however if you find the
> effect too sharp then drop the surrounding
> values towards 0 and re-weight the kernel to 1, you can do this by calling
> SetSharpen() with an input weight of less
> than 1. Obviously calling it with an input weight of more than 1 enhances
> the effect, but can lead to some strange
> results when going too high.
> Hope this helps,
>
> Mike
>
> P.s. If you scale your image with the Halftone interpolation mode set then
> the scaling algorithm performs some degree of
> edge sharpening for you.
>
>
> - Microsoft Visual Basic MVP -
> E-Mail: EDais@xxxxxxxx
> WWW: Http://EDais.mvps.org/
>
>


.



Relevant Pages

  • Re: Code Needed For Getting Process Filehandle in C++
    ... window) and GDI ones), and these handle types are managed independently ... Kernel and GDI handles are valid only in context of a given process, ...
    (microsoft.public.win32.programmer.kernel)
  • Re: how to use DrvEnablePDEV to obtain GDIINFO of the display device?
    ... The kernel filter you guys are referring to is the kernel driver's filter ... and not any OS component filter for GDI. ... Most relevant members of GDIINFO are exposed using GetDeviceCapswin32 ...
    (microsoft.public.development.device.drivers)
  • Re: why GUI part of the kernel
    ... GDI is implemented in kernel, ... reasons. ... he should have said "GUI ...
    (microsoft.public.win32.programmer.kernel)
  • Re: API references
    ... > same source as for KERNEL and GDI. ... I searched the MSDN node in ... > vain. ...
    (comp.lang.asm.x86)
  • Re: API references
    ... > same source as for KERNEL and GDI. ... I searched the MSDN node in ... > vain. ...
    (comp.lang.asm.x86)