From: mayayana on


--
>
> Search your code for CreateDIBSection(), that's the key to creating your
DIB back-buffer.
> Here's an old post with some pretty bare-bones DIB buffer creation:
>
http://groups.google.co.uk/group/microsoft.public.vb.winapi.graphics/msg/4f9
41fe33eef7264
> Ignore the middle bit (messing around with VarPtrArray(), RtlMoveMemory()
and such,) you only need the GDI calls at the
> top and bottom of the example code.
> Hope this helps,
>
Thanks. I've also been reading your DIB article.
It's nice -clear and informative, so I already know where
you're going with the array ops.



From: Mike D Sutton on
> Thanks. I've also been reading your DIB article.
> It's nice -clear and informative, so I already know where
> you're going with the array ops.

Ok, good good. In your case though, unless you're doing any image manipulation you should need to do anything with the
data itself.

Mike


- Microsoft Visual Basic MVP -
E-Mail: EDais(a)mvps.org
WWW: Http://EDais.mvps.org/


From: mayayana on
Another question...

Now I also want to do resizing. From my research
it appears that setting HALFTONE mode for
StretchBlt is the highest quality, but that it doesn't
work properly on Win9x even when the extra Win9x
steps are carried out? (According to the docs, only
SetBrushOrgEx is required on NT but 9x requires
further calls. I've found sample code for that, but I've
also found old posts that imply it doesn't work.)

I'm trying to figure out the very best way to do a resize
on both 9x and NT. Perhaps there's some kind of
HALFTONE algorithm if it won't work on 9x via API?

---------

An interesting sign of the times:
I entered this in Google:

"SetBrushOrgEx bitmap vb nt"

It returned this:

"Did you mean: SetBrushOrgEx bitmap vb net"


From: Mike D Sutton on
> Now I also want to do resizing. From my research
> it appears that setting HALFTONE mode for
> StretchBlt is the highest quality, but that it doesn't
> work properly on Win9x even when the extra Win9x
> steps are carried out? (According to the docs, only
> SetBrushOrgEx is required on NT but 9x requires
> further calls. I've found sample code for that, but I've
> also found old posts that imply it doesn't work.)
>
> I'm trying to figure out the very best way to do a resize
> on both 9x and NT. Perhaps there's some kind of
> HALFTONE algorithm if it won't work on 9x via API?

HALFTONE interpolation is not supported under Win9x or Me, If you want high-quality image resampling which is constant
over various OS' then I'd suggest you look into a 3'rd party graphics library, FreeImage for example is a pretty popular
one (http://freeimage.sourceforge.net/)
Hope this helps,

Mike


- Microsoft Visual Basic MVP -
E-Mail: EDais(a)mvps.org
WWW: Http://EDais.mvps.org/


From: Mike Williams on
"mayayana" <mayaXXyana1a(a)mindXXspring.com> wrote in message
news:k6hJg.3216$xQ1.888(a)newsread3.news.pas.earthlink.net...

> I'm trying to figure out the very best way to do
> a resize on both 9x and NT. Perhaps there's
> some kind of HALFTONE algorithm if it won't
> work on 9x via API?

As Mike Sutton has already said, halftone is not available under Win9x and
you might be better off using a third party graphics library, or perhaps
GDI+, which I believe is possible under Win 9x although I'm not sre about
that). Before you do that though (or perhaps in addition to doing it) you
might like to check out the LoadImage API. It won't load jpegs of course,
but there are ways of getting around that problem by first converting the
jpeg to a bitmap and then loading the bitmap with LoadImage. No point in
going to all that trouble without checking it out in a simple way first
though to see if the quality is sufficient for your needs. The LoadImage
API, whch will work under Win9x as well as WinXP, can load and stretch a
bitmap into a device and it appears to use its own stretch algorithm which
to my eyes appears to be at least as good as halftone. To test it in the
simplest possible way just make sure your own system is set to 32 bit full
colour, load a jpg into a full size picture box and save it out as a bitmap.
Then pull the bitmap in using the LoadImage API, using suitable parameters
that cause it to stretch the picture to whatever size you require. Check
that against loading the same jpeg in the standard way and using StretchBlt
mode 3 to stretch it (by the way, you are using stretch mode 3 in Win9x are
you?). If you think the LoadImage stretch quality is no better than Mode 3
then you haven't wasted a lot of time, and if you think it is better then
you might think it worth going to the extra bit of trouble required to
overcome the limitations on machines running at 16 bit colour depth.

Mike