Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 360
  • Last Modified:

StretchBlt Distortion On MY Screen

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
lesher
Asked:
lesher
1 Solution
 
NickRepinCommented:
Call SetStretchBltMode before stretching the bitmap.

Try different parameters for iStretchMode of SetStretchBltMode.
0
 
nietodCommented:
Are you making the image larger or smaller?
0
 
lesherAuthor Commented:
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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
nietodCommented:
>> 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
 
xLsCommented:
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
 
nietodCommented:
>> 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
 
nietodCommented:
lesher, do you understand how experts exchange works?
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Tackle projects and never again get stuck behind a technical roadblock.
Join Now