Click to See Complete Forum and Search --> : display question
celtics
December 5th, 2003, 11:54 PM
mfc/sdi:
using stretchdibits with rgb setting that creates b&w image but with some black spots:
for(int i=0; i<256; i++) {
p->bColors[i].rgbBlue = i;
p->bColors[i].rgbGreen = i;
p->bColors[i].rgbRed = i;
p->bColors[i].rgbReserved = 0;
}
this part seems to be fine. but maybe needs to go along with some other stuff with it to make the display better, sharper,..???
any suggestions?.
Marc G
December 7th, 2003, 10:33 AM
What do you mean with black spots?
If you want to make your images sharper, you can do so in Photoshop or something or write your own image filter in your program. Check www.codeguru.com, i'm sure some image filter classes have been posted there.
Mathew Joy
December 8th, 2003, 05:18 AM
Hi Celtics,
I'm not sure by what you need. If you want to turn a picture into gray scale, there are other better ways than reading each pixel and converting them. One of them (although I'm not sure how to do) is to create a gray scale bitmap and select your bitmap into it. You'll get many hits in a search on google.groups.
If you need to change the brightness, contrast etc.. you can set the SetStretchBltMode() to HALFTONE. You can get an example program here (http://download.microsoft.com/download/platformsdk/sample29/1/W97/EN-US/Halftone.exe).
Hope this is what you are looking for.
Marc G
December 8th, 2003, 06:49 AM
Mathew thanks for that links, I didn't know that changing brightness, contrast and gamma was build in into the Win32 API (atleast for NT or later).
codeguru.com
Copyright 2007 Jupitermedia Corporation All Rights Reserved.