Click here to Skip to main content
15,911,646 members
Home / Discussions / C#
   

C#

 
GeneralRe: Check who has taken the handle of the text file. Pin
Calla22-Feb-10 21:37
Calla22-Feb-10 21:37 
GeneralRe: Check who has taken the handle of the text file. [modified] Pin
Sunil G22-Feb-10 21:40
Sunil G22-Feb-10 21:40 
GeneralRe: Check who has taken the handle of the text file. Pin
Calla22-Feb-10 22:14
Calla22-Feb-10 22:14 
GeneralRe: Check who has taken the handle of the text file. Pin
Manoj_Leo23-Feb-10 6:42
Manoj_Leo23-Feb-10 6:42 
AnswerRe: Check who has taken the handle of the text file. Pin
Saksida Bojan23-Feb-10 1:31
Saksida Bojan23-Feb-10 1:31 
GeneralRe: Check who has taken the handle of the text file. Pin
Sunil G23-Feb-10 2:29
Sunil G23-Feb-10 2:29 
QuestionImage Interpolation Pin
Steven Schmoll22-Feb-10 18:40
Steven Schmoll22-Feb-10 18:40 
AnswerRe: Image Interpolation Pin
RichardM123-Feb-10 14:50
RichardM123-Feb-10 14:50 
This is not the speedy solution.
You are mapping your src pixels to your dest pixels. Instead of skipping pixels, just walk through each dest pixel and figure out a double for src x and y. The fractional part of the x and y can be used for weighting your source pixels - bi-linear.

int   xSrcIdx = (float)Math.Floor(xSrc);
float xFrac = xSrc - xSrcIdx;
int   ySrcIdx = (float)Math.Floor(ySrc);
float yFrac = ySrc - ySrcIdx;
Color c00 = src.GetPixel(xSrcIdx, ySrcIdx);
Color c01 = src.GetPixel(xSrcIdx, ySrcIdx+1);
Color c10 = src.GetPixel(xSrcIdx+1, ySrcIdx);
Color c11 = src.GetPixel(xSrcIdx+1, ySrcIdx+1);

Color c0  = InterpretColor(c00,c01,yFrac);
Color c1  = InterpretColor(c10,c11,yFrac);

Color c   = InterpretColor(c0 ,c1 ,xFrac);

dest.SetPixel(Convert.ToInt32(Math.Floor(x)), Convert.ToInt32(Math.Floor(y)), col);


Where InterpretColor(Color c1, Color c2, float frac) returns a linear interpolation between c1 and c2. This will give you some of the smoothing you want. The problem is that when the delta between source pixels >> 1, you start getting visual anomalies, and might want to have another method that combines multiple (> 2x2) pixels back into the dest.
Opacity, the new Transparency.

GeneralRe: Image Interpolation Pin
Steven Schmoll23-Feb-10 16:43
Steven Schmoll23-Feb-10 16:43 
QuestionWarning Message box Pin
shahramkeyboard22-Feb-10 8:48
shahramkeyboard22-Feb-10 8:48 
AnswerRe: Warning Message box Pin
Not Active22-Feb-10 11:54
mentorNot Active22-Feb-10 11:54 
QuestionC# .net.Mail Pin
Jamelon6922-Feb-10 8:19
Jamelon6922-Feb-10 8:19 
AnswerRe: C# .net.Mail Pin
DaveyM6922-Feb-10 8:29
professionalDaveyM6922-Feb-10 8:29 
AnswerRe: C# .net.Mail Pin
Dr.Walt Fair, PE22-Feb-10 8:31
professionalDr.Walt Fair, PE22-Feb-10 8:31 
AnswerRe: C# .net.Mail Pin
Gaurav Dudeja India22-Feb-10 19:20
Gaurav Dudeja India22-Feb-10 19:20 
AnswerRe: C# .net.Mail Pin
Richard MacCutchan22-Feb-10 22:16
mveRichard MacCutchan22-Feb-10 22:16 
QuestionBest way to read ASCII input [modified] Pin
spainchaud22-Feb-10 6:13
spainchaud22-Feb-10 6:13 
AnswerRe: Best way to read ASCII input Pin
harold aptroot22-Feb-10 6:32
harold aptroot22-Feb-10 6:32 
GeneralRe: Best way to read ASCII input Pin
spainchaud22-Feb-10 6:38
spainchaud22-Feb-10 6:38 
AnswerRe: Best way to read ASCII input [modified] Pin
Saksida Bojan22-Feb-10 6:36
Saksida Bojan22-Feb-10 6:36 
GeneralRe: Best way to read ASCII input Pin
harold aptroot22-Feb-10 6:39
harold aptroot22-Feb-10 6:39 
AnswerRe: Best way to read ASCII input Pin
Dr.Walt Fair, PE22-Feb-10 7:03
professionalDr.Walt Fair, PE22-Feb-10 7:03 
GeneralRe: Best way to read ASCII input Pin
spainchaud22-Feb-10 8:48
spainchaud22-Feb-10 8:48 
GeneralRe: Best way to read ASCII input Pin
Dr.Walt Fair, PE22-Feb-10 9:23
professionalDr.Walt Fair, PE22-Feb-10 9:23 
GeneralRe: Best way to read ASCII input Pin
Scott Serl22-Feb-10 10:13
Scott Serl22-Feb-10 10:13 

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.