Solved

StretchBlt Distortion On MY Screen

Posted on 2000-03-18
7
328 Views
Last Modified: 2013-12-03
I use StretchBlt to display bitmaps thst I earlyer created with Photoshop V. 4.0.If the bitmap file was prepared rom a previouse scaned photo than the output is fine.If it was a cartoon taken from a Clipart cd-rom, than it is looked mostly grayscaled and only few areas looked ok, in the c program (while in Photoshop it looks fine).
I tryed to save the bitmap file in different modes(Indexed,RGB...)but nothing helped.

Thanks In Advance

Lesher Izack
0
Comment
Question by:lesher
7 Comments
 
LVL 15

Expert Comment

by:NickRepin
ID: 2633028
Call SetStretchBltMode before stretching the bitmap.

Try different parameters for iStretchMode of SetStretchBltMode.
0
 
LVL 22

Expert Comment

by:nietod
ID: 2633079
Are you making the image larger or smaller?
0
 

Author Comment

by:lesher
ID: 2635525
Even if I try to open the bitmaps with Bitblt(and not in Strechblt) it does not help.It means the problem exists somewhere else.

Thanks
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 22

Expert Comment

by:nietod
ID: 2635669
>> if I try to open the bitmaps with Bitblt(and not in Strechblt)
You can't "open" them with these functions.

>> it means the problem
>> exists somewhere else
Why?

If you stratch a bitmap it will look different.  You can't avoid that.  If you increase the size the bitmap will begin to get "chunky"  That is, you will start seeing large blocks of pixels and the edges of things will become "jagged".  If you scrink the bitmap you will loose detail.  Small peices of detail will be lost, faint portions may dissappear, the image may become darker (all this depends on the mode), but in any case the results will be a degradation in the image qauality.
0
 
LVL 2

Accepted Solution

by:
xLs earned 200 total points
ID: 2638494
first StrechBlt may with some graphic cards be hw accelerated, which means it could give quite good quality, since the hardware will add a billiar filter(or any present) and will make the result look good. if your card does not support this StrechBlt gives a pretty ugly result(ugly distored lines every now and then and some ugly pixels).

However it seems like you have problems with loading the image properly. if you use the LoadImage
done with
HANDLE hBitmap = LoadImage(NULL,"file.bmp",IMAGE_BITMAP,LR_DEFAULTSIZE,LR_DEFAULTSIZE,LR_LOADFROMFILE);
//then use StretchBlt(...,..,hBitmap,...);

DeleteObject(hBitmap);

// This should atleast give you a a proper loading of the bitmap.


Good luck on you :)
/xLs
0
 
LVL 22

Expert Comment

by:nietod
ID: 2639795
>> StrechBlt may with some graphic cards be hw
>> accelerated, which means it could give quite
>> good quality
It can't prevent degradation of the image.  Nothing can.
0
 
LVL 22

Expert Comment

by:nietod
ID: 2644357
lesher, do you understand how experts exchange works?
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
error email attachment VB2010 5 54
Launching Internet Explorer inPrivate mode using VBA 14 561
Windows Installer 4 76
C#: need to import an entire CSV file 4 60
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question