Solved

StretchBlt Distortion On MY Screen

Posted on 2000-03-18
7
342 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

626 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