Re: Graphics in Win32lib
- Posted by mistertrik at hotmail.com Oct 10, 2002
- 476 views
This is a multi-part message in MIME format. ------=_NextPart_000_1523_1b0b_102 Thanks Martin. There's a problem with it though, I think it's the fault of the win function rather than your code, because I found the same thing occurring in a contribution Windows Animation Effect (that used stretchblt as well). My bitmap (in the .zip) has a section that goes from black to orange as a smooth graduation. When it is resized smaller, dark bands appear in the middle of the section. I found a similar thing with the turtle bitmap, although it had to be resized quite small before the effect was noticed. Does anyone know why this is, because such a glitch is not acceptable for my purposes? I'm running Win2k here if that helps. Thanks ===================================================== .______<-------------------\__ / _____<--------------------__|=== ||_ <-------------------/ \__| Mr Trick >From: Martin Stachon <martin.stachon at worldonline.cz> >Reply-To: EUforum at topica.com >To: EUforum <EUforum at topica.com> >Subject: Re: Graphics in Win32lib >Date: Thu, 10 Oct 2002 18:03:55 +0200 > > >Try my "Stretch Bitmap Demo" in Rec Usr Contrib. > > Martin > > > GDI? What is that? > > > > > > >From: Don Phillips <EuNexus at yahoo.com> > > >Reply-To: EUforum at topica.com > > >To: EUforum <EUforum at topica.com> > > >Subject: Re: Graphics in Win32lib > > >Date: Wed, 9 Oct 2002 22:13:42 -0700 (PDT) > > > > > > > > >Try StretchBlt and SetStretchBltMode from GDI32. These functions copy >from > > >one DC to another but allow the destination rectangle to be either >smaller > > >or larger the the source rectangle. If so, Windows will scale the >image > > >accordingly. > > >Don Phillips > > > > > >I need to be able to display background images in my window, but as >this is > > >destined to be used by people other than myself, I want it to scale > > >gracefully on other resolutions. > > > > > >At the moment I just use loadbitmapfromfile and BLT it to the screen, >but > > >how would I have a single bitmap image, that I can output as a smaller > > >size? > > > > > >I know how to make a simple scaling algorithm if one does not already > > >exist, > > >but how would I get access to the 2d array that loadbitmapfromfile no >doubt > > >puts somewhere, and how would I save my altered array into a bitmap >object? > > > > > >...If that made sense, that is. > > >===================================================== > > >.______<-------------------\__ > > >/ _____<--------------------__|=== > > >||_ <-------------------/ > > >\__| Mr Trick > > > > > > > > ><P>Try StretchBlt and SetStretchBltMode from GDI32. These >functions > > >copy from one DC to another but allow the destination rectangle to be > > >either smaller or larger the the source rectangle. If so, Windows > > >will scale the image accordingly. > > ><P>Don Phillips > > ><P> <B><I>mistertrik at hotmail.com</I></B> wrote: > > ><b><a href="http://news.yahoo.com/">Yahoo! News</a></b> - Today's >headlines > > > > > > > > ===================================================== > > .______<-------------------\__ > > / _____<--------------------__|=== > > ||_ <-------------------/ > > \__| Mr Trick > > > > > > ------=_NextPart_000_1523_1b0b_102 Content-Type: application/x-zip-compressed; name="fireball.zip"