Click here to Skip to main content
15,890,282 members
Home / Discussions / C#
   

C#

 
Answerrealy want help Pin
Miss_hacker8-Jun-08 7:32
Miss_hacker8-Jun-08 7:32 
GeneralRe: realy want help Pin
Garth J Lancaster8-Jun-08 14:32
professionalGarth J Lancaster8-Jun-08 14:32 
QuestionWhich Image Would Make A Better Splash Screen Background? Pin
That Asian Guy8-Jun-08 7:14
That Asian Guy8-Jun-08 7:14 
AnswerRe: Which Image Would Make A Better Splash Screen Background? Pin
Gareth H8-Jun-08 7:29
Gareth H8-Jun-08 7:29 
GeneralRe: Which Image Would Make A Better Splash Screen Background? Pin
That Asian Guy8-Jun-08 8:15
That Asian Guy8-Jun-08 8:15 
AnswerRe: Which Image Would Make A Better Splash Screen Background? Pin
Anthony Mushrow8-Jun-08 13:36
professionalAnthony Mushrow8-Jun-08 13:36 
Questionan other-other image processing Pin
Sajjad Izadi8-Jun-08 5:40
Sajjad Izadi8-Jun-08 5:40 
AnswerRe: an other-other image processing [modified] Pin
User 66588-Jun-08 6:40
User 66588-Jun-08 6:40 
This requires some math, albeit some very simple math.
You need two pictures (actually, you can calculate the luma value on the fly inside the lerp method, but this one is a bit simpler and faster, but uses twice the memory):

1) the colored version
2) the grayscale/bw version

Then, based on a timer for the fading transition (let's say 5 seconds from colored to BW) you simply do a linear interpolation[^] between the colored pixel value to the BW pixel value on a time range from 0 to 1.

In a timer, you could do this (pseudocode):

const float transitionTime = 5000f; // 5 seconds
float normalizedTransitionTime = millsecondsSinceTransitionStart / transitionTime;

red = (byte)Lerp(normalizedTransitionTime , coloredPixelR, bwPixelR);
green = (byte)Lerp(normalizedTransitionTime , coloredPixelG, bwPixelG);
blue = (byte)Lerp(normalizedTransitionTime , coloredPixelB, bwPixelB);


What the method Lerp[^] does is simply a interpolation in the form

value1 + (value2 - value1) * amount


as used in the XNA framework (for example)

float Lerp(float amount, float value1, float value2)
{
   return value1 + (value2 - value1) * amount;
}


regards

modified on Sunday, June 8, 2008 12:51 PM


modified 12-Sep-18 21:01pm.

GeneralRe: an other-other image processing Pin
Sajjad Izadi8-Jun-08 9:26
Sajjad Izadi8-Jun-08 9:26 
Questionssis package in C# Pin
Member 40084928-Jun-08 5:36
Member 40084928-Jun-08 5:36 
QuestionWhat is this advantage? Pin
ASysSolvers8-Jun-08 3:19
ASysSolvers8-Jun-08 3:19 
AnswerRe: What is this advantage? Pin
S. Senthil Kumar8-Jun-08 3:27
S. Senthil Kumar8-Jun-08 3:27 
QuestionPredicates and foreach Problem [modified] Pin
Jammer8-Jun-08 0:41
Jammer8-Jun-08 0:41 
AnswerRe: Predicates and foreach Problem Pin
leppie8-Jun-08 1:20
leppie8-Jun-08 1:20 
GeneralRe: Predicates and foreach Problem Pin
Jammer8-Jun-08 1:22
Jammer8-Jun-08 1:22 
GeneralRe: Predicates and foreach Problem Pin
Jammer8-Jun-08 1:32
Jammer8-Jun-08 1:32 
GeneralRe: Predicates and foreach Problem [modified] Pin
Jammer8-Jun-08 2:31
Jammer8-Jun-08 2:31 
GeneralRe: Predicates and foreach Problem Pin
leppie8-Jun-08 2:48
leppie8-Jun-08 2:48 
QuestionApplications on Servers Pin
jonhbt7-Jun-08 22:50
jonhbt7-Jun-08 22:50 
AnswerRe: Applications on Servers Pin
Gareth H7-Jun-08 23:45
Gareth H7-Jun-08 23:45 
QuestionRe: Applications on Servers Pin
jonhbt7-Jun-08 23:59
jonhbt7-Jun-08 23:59 
AnswerRe: Applications on Servers Pin
Zoltan Balazs8-Jun-08 0:27
Zoltan Balazs8-Jun-08 0:27 
QuestionWhen do we have to use delegate in C#? Pin
Mohammad Dayyan7-Jun-08 22:46
Mohammad Dayyan7-Jun-08 22:46 
AnswerRe: When do we have to use delegate in C#? Pin
MarkB7777-Jun-08 23:44
MarkB7777-Jun-08 23:44 
GeneralRe: When do we have to use delegate in C#? Pin
Mohammad Dayyan8-Jun-08 0:52
Mohammad Dayyan8-Jun-08 0:52 

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.