Click here to Skip to main content
15,882,278 members
Home / Discussions / Graphics
   

Graphics

 
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 
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 
Ok, you have two files now but you only still have one bitmap in memory, especially the image variable. You're reading from it, operating on the pixels, and writing them back in place. You read the first file into memory and immediately read over the data in memory from the second. Not good.

If you're going to use a global for the pixel matrix, get_pixel would have to work on the original image and set_pixel on the output image. A better way would be to write general functions that have a pointer to the pixel matrix as a parameter, then you'd be set.

The other thing that has jarred my consciousness is the calcualtion of the index when you're accessing a pixel in image, ie "image[bmp.biHeight+y*bmp.biWidth+x]". Why the offset "bmp.biHeight"? Shouldn't the index to the pixel just be "y*bmp.biWidth+x"?

Hard to tell some of this since for some reason your for loops don't seem to copy well. Are you using tabs in your code rather than spaces? Anyhow, it looks like you're closing in on doing the loop ranges on row and column properly from how I remember kernels. The starting index being one, however, you need to subtract 1 from the end test or you'll run off the edge. More properly, you have to allow a border of KernelSize/2 around the edge of your image since you can't really apply a kernel to those pixels. I'm not sure the stuff in the middle is correct but it's hard to make out. You're going to force me to actually look up Gaussian blur. Sigh | :sigh:

If you don't have the data, you're just another a**hole with an opinion.

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 
GeneralRe: Bitmap blur problem Pin
Tim Craig9-Jun-08 17:27
Tim Craig9-Jun-08 17:27 
GeneralRe: Bitmap blur problem Pin
Naturality9-Jun-08 17:49
Naturality9-Jun-08 17:49 
GeneralRe: Bitmap blur problem Pin
Christian Graus9-Jun-08 19:15
protectorChristian Graus9-Jun-08 19:15 
GeneralRe: Bitmap blur problem Pin
Tim Craig9-Jun-08 20:32
Tim Craig9-Jun-08 20:32 
GeneralRe: Bitmap blur problem Pin
Tim Craig9-Jun-08 20:35
Tim Craig9-Jun-08 20:35 

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.