Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > API > StretchBlt and fuzzy colours


Reply
 
Thread Tools Display Modes
  #1  
Old 08-09-2001, 03:46 PM
Sophay
Guest
 
Posts: n/a
Question StretchBlt and fuzzy colours


Hello, I have some problems using the API function StretchBlt. All is OK when I enlarge a picture. But When I reduce it, colours turn bad (red, yellow, green and strokes of other colours appear). I tried with Win98 and WinNT but the problem remains...Help!

Reply With Quote
  #2  
Old 08-11-2001, 10:55 AM
Garrett Sever's Avatar
Garrett Sever Garrett Sever is offline
Strange Brewer

Retired Moderator
* Guru *
 
Join Date: Jun 2001
Location: AddressOf Insomnia
Posts: 2,815
Default Re: StretchBlt and fuzzy colours

The problem you are referring to is actually an anti-aliasing issue. Perhaps you've heard all the discussion about "full-screen antialiasing" and so-forth for the next gen consoles coming out (Xbox, GameCube, etc).

The idea is that if you create a game screen larger than can fit on the TV screen, and then use full-screen anti-aliasing to shrink the image without losing pixels (some are combined to form another pixel color that blends the original ones), then your level of detail is much greater... not to mention its easier to program & its faster if you anti-alias the whole screen rather than tons of tiny areas.

So now you know the name of your problem... I suggest you go to VB Helper and search his Example Programs. Rod Stephens wrote an excellent book entitled "Visual Basic Graphics Programming" which has a section that covers EXACTLY you issue as well.

I will tell you that shrinking an image is historically problematic, and that you are not going to find one single API that will do what you want. Instead, you are going to have to use the "GetBitmapPixels" API, loop through every pixel and do some color averaging, and then use "SetBitmapPixels" on the new bitmap to blit it back.

Anti-aliasing is a real pain in practice.

Regards, and good luck,
-The Hand

<font color=green>"On a long enough timeline, everyone's life expectancy drops to zero."</font color=green> - Fight Club
__________________
"The lights below
You know they'll bleed forever
Get back as the cores blow
Let me fall..." - Dismantled, "Cornered"
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->