Click here to Skip to main content
16,004,927 members
Home / Discussions / C#
   

C#

 
AnswerRe: move image through a path Pin
Christian Graus10-Mar-07 5:43
protectorChristian Graus10-Mar-07 5:43 
GeneralRe: move image through a path Pin
waleed9910-Mar-07 21:13
waleed9910-Mar-07 21:13 
QuestionProblem with painting a form Pin
-raada-10-Mar-07 5:06
-raada-10-Mar-07 5:06 
AnswerRe: Problem with painting a form Pin
Christian Graus10-Mar-07 5:15
protectorChristian Graus10-Mar-07 5:15 
GeneralRe: Problem with painting a form Pin
-raada-10-Mar-07 7:49
-raada-10-Mar-07 7:49 
GeneralRe: Problem with painting a form Pin
Christian Graus10-Mar-07 8:10
protectorChristian Graus10-Mar-07 8:10 
AnswerRe: Problem with painting a form Pin
Luc Pattyn10-Mar-07 15:15
sitebuilderLuc Pattyn10-Mar-07 15:15 
GeneralRe: Problem with painting a form Pin
-raada-12-Mar-07 12:03
-raada-12-Mar-07 12:03 
Hi Luc,

well ... I supppose that the most used setting will lead to 160 or 80 Hz frequency when 256 long array of transformed double values has to be processed by painting algorythm.

here is sample code

private void DrawDFTSample(double[] sample, Graphics g)
{
	Range yRange = description.YRange;
	double colorIndex = 0;
	double colorIndexStep = description.Colors.Length / sample.Length;
	double fi;	//frequency intensity

	int yGraphBeginning = Height;	// subtract value to display from this

	double yDisplay;
	int xDisplay = currentRectangle.X + currentRectangle.Width / 2;

	Pen p = new Pen(Color.Red);
	p.Width = (currentRectangle.Width > 1) ? currentRectangle.Width - 1 : 1;

	double threshold = 0;
			
	yDisplay = yGraphBeginning;

	for(int i=0; i<sample.Length; i++)
	{
		fi = sample[i];
		if(fi >= threshold)
		{
			p.Color = description.Colors[(int)colorIndex];
			yDisplay -= yPixStep;
			g.DrawLine(p, xDisplay-1, (int)yDisplay, xDisplay+1, (int)yDisplay);
		}
		colorIndex += colorIndexStep;
	}

	counter++;
	currentRectangle.X = (int)((double)counter * xPixStep);
}


Now I will try to optimize it by storing already computed values into array of points so I will be able to just draw them without reprocessing signal values when need to repaint whole signal occur.

Hope it will help me Smile | :)
GeneralRe: Problem with painting a form Pin
Luc Pattyn12-Mar-07 12:37
sitebuilderLuc Pattyn12-Mar-07 12:37 
QuestionError Pin
shamsteady10-Mar-07 4:43
shamsteady10-Mar-07 4:43 
AnswerRe: Error Pin
Christian Graus10-Mar-07 4:48
protectorChristian Graus10-Mar-07 4:48 
GeneralRe: Error Pin
shamsteady10-Mar-07 5:00
shamsteady10-Mar-07 5:00 
GeneralRe: Error Pin
Christian Graus10-Mar-07 5:16
protectorChristian Graus10-Mar-07 5:16 
AnswerRe: Error Pin
M-Hall10-Mar-07 6:48
M-Hall10-Mar-07 6:48 
GeneralRe: Error Pin
shamsteady10-Mar-07 7:01
shamsteady10-Mar-07 7:01 
GeneralRe: Error Pin
Christian Graus10-Mar-07 7:27
protectorChristian Graus10-Mar-07 7:27 
QuestionDo you know any API that can get the name of DVD movie? [modified] Pin
Khoramdin10-Mar-07 4:30
Khoramdin10-Mar-07 4:30 
AnswerRe: Do you know any API that can get the name of DVD movie? Pin
Christian Graus10-Mar-07 5:17
protectorChristian Graus10-Mar-07 5:17 
QuestionRe: Do you know any API that can get the name of DVD movie? Pin
Khoramdin11-Mar-07 9:31
Khoramdin11-Mar-07 9:31 
QuestionNeed help creating thumbnails Pin
Mark F.10-Mar-07 4:15
Mark F.10-Mar-07 4:15 
AnswerRe: Need help creating thumbnails Pin
Christian Graus10-Mar-07 5:17
protectorChristian Graus10-Mar-07 5:17 
GeneralRe: Need help creating thumbnails [modified] Pin
Mark F.10-Mar-07 6:07
Mark F.10-Mar-07 6:07 
QuestionTrail of Tears... (i.e. Control Locations) [modified] Pin
new_phoenix10-Mar-07 2:47
new_phoenix10-Mar-07 2:47 
AnswerRe: Trail of Tears... (i.e. Control Locations) Pin
Guffa10-Mar-07 4:35
Guffa10-Mar-07 4:35 
GeneralRe: Trail of Tears... (i.e. Control Locations) [modified] Pin
new_phoenix10-Mar-07 7:05
new_phoenix10-Mar-07 7:05 

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.