Click here to Skip to main content
15,909,332 members
Home / Discussions / Graphics
   

Graphics

 
AnswerRe: change color in image Pin
Tim Craig17-Jun-08 18:22
Tim Craig17-Jun-08 18:22 
QuestionHow to get the Codec Name of the Video using directshow Pin
Kuldeep Bhatnagar13-Jun-08 1:23
Kuldeep Bhatnagar13-Jun-08 1:23 
QuestionBitmap.FromFile(filepath) - exception Out of memory Pin
Krishnraj11-Jun-08 23:43
Krishnraj11-Jun-08 23:43 
AnswerNET Framework Bitmap Pin
Baltoro12-Jun-08 5:39
Baltoro12-Jun-08 5:39 
Question[Solved] Cropping empty space around drawing [modified] Pin
kensai11-Jun-08 0:32
kensai11-Jun-08 0:32 
AnswerRe: [Solved] Cropping empty space around drawing Pin
kensai11-Jun-08 2:27
kensai11-Jun-08 2:27 
QuestionHow to set filter property through code without popping up property page Pin
Aamol M10-Jun-08 3:47
Aamol M10-Jun-08 3:47 
QuestionBitmap blur problem [modified] Pin
Naturality7-Jun-08 14:49
Naturality7-Jun-08 14:49 
Hi, I have a program that is supposed to blur bitmaps in a Gaussian type fashion.
However, all this does is change the light greys to a yellow-ey colour.
Here is some code:

Functions:
void set_pixel(int x,int y, RGBTRIPLE colour){	
	image[(bmp.biHeight-1-y)*bmp.biWidth+x] = colour;
}

void get_pixel(int x, int y, RGBTRIPLE colour){
	colour = image[(bmp.biHeight-1-y)*bmp.biWidth+x];
	}


void avg(RGBTRIPLE colour[], RGBTRIPLE merge, int size) {
    for(int i=0; i<size; i++)="" {<br="" mode="hold" />		merge.rgbtBlue += colour[i].rgbtBlue;
		merge.rgbtGreen += colour[i].rgbtGreen;
		merge.rgbtRed += colour[i].rgbtRed;
    }
	merge.rgbtBlue = merge.rgbtBlue / size;
	merge.rgbtGreen= merge.rgbtGreen / size;
	merge.rgbtRed  = merge.rgbtRed / size;
}


Implementation:
for(int y = 0; y < bmp.biHeight; y=y+3){
	for(int x = 0; x <bmp.biwidth; x="x+3){<br=""" mode="hold" />		for(int i = 0; i < 9; i++){
		int yp=0, xp=0;
		get_pixel(x+xp,y+yp,blank[i]);  // blank is an RGBTRIPLE array
		if(xp<3)
			xp++;
		else{
			xp = 0;
			yp++;
		}
		}
		avg(blank, Merge, 9);
		set_pixel(x,y,Merge);
}}


Any help you can give would be much appreciated. Thanks Smile | :)

modified on Saturday, June 7, 2008 9:35 PM

AnswerRe: Bitmap blur problem Pin
Christian Graus7-Jun-08 16:11
protectorChristian Graus7-Jun-08 16:11 
AnswerRe: Bitmap blur problem Pin
Tim Craig7-Jun-08 19:46
Tim Craig7-Jun-08 19:46 
GeneralRe: Bitmap blur problem [modified] Pin
Naturality8-Jun-08 2:29
Naturality8-Jun-08 2:29 
GeneralRe: Bitmap blur problem Pin
Tim Craig8-Jun-08 7:56
Tim Craig8-Jun-08 7:56 
GeneralRe: Bitmap blur problem Pin
Naturality8-Jun-08 11:11
Naturality8-Jun-08 11:11 
GeneralRe: Bitmap blur problem Pin
Tim Craig8-Jun-08 11:25
Tim Craig8-Jun-08 11:25 
GeneralRe: Bitmap blur problem Pin
Naturality8-Jun-08 13:11
Naturality8-Jun-08 13:11 
GeneralRe: Bitmap blur problem Pin
Tim Craig8-Jun-08 18:58
Tim Craig8-Jun-08 18:58 
GeneralRe: Bitmap blur problem [modified] Pin
Naturality9-Jun-08 4:44
Naturality9-Jun-08 4:44 
GeneralRe: Bitmap blur problem Pin
Tim Craig9-Jun-08 9:05
Tim Craig9-Jun-08 9:05 
GeneralRe: Bitmap blur problem Pin
Naturality9-Jun-08 9:11
Naturality9-Jun-08 9:11 
GeneralRe: Bitmap blur problem Pin
Naturality9-Jun-08 10:06
Naturality9-Jun-08 10:06 
GeneralRe: Bitmap blur problem Pin
Tim Craig9-Jun-08 14:32
Tim Craig9-Jun-08 14:32 
GeneralRe: Bitmap blur problem Pin
Tim Craig9-Jun-08 15:10
Tim Craig9-Jun-08 15:10 
GeneralRe: Bitmap blur problem Pin
Naturality9-Jun-08 15:43
Naturality9-Jun-08 15:43 
GeneralRe: Bitmap blur problem Pin
Christian Graus9-Jun-08 17:00
protectorChristian Graus9-Jun-08 17:00 
GeneralRe: Bitmap blur problem Pin
Naturality9-Jun-08 17:06
Naturality9-Jun-08 17:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.