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

C#

 
Questionwhy they don't show up Pin
neverpleat20-Sep-10 14:50
neverpleat20-Sep-10 14:50 
AnswerRe: why they don't show up Pin
Luc Pattyn20-Sep-10 15:02
sitebuilderLuc Pattyn20-Sep-10 15:02 
GeneralRe: why they don't show up Pin
neverpleat20-Sep-10 15:20
neverpleat20-Sep-10 15:20 
GeneralRe: why they don't show up Pin
Luc Pattyn20-Sep-10 15:36
sitebuilderLuc Pattyn20-Sep-10 15:36 
GeneralRe: why they don't show up [modified] Pin
neverpleat20-Sep-10 17:17
neverpleat20-Sep-10 17:17 
AnswerRe: why they don't show up Pin
Abhinav S20-Sep-10 18:17
Abhinav S20-Sep-10 18:17 
AnswerRe: why they don't show up Pin
phil.o21-Sep-10 0:08
professionalphil.o21-Sep-10 0:08 
Questionwhere to manage my picture box control Pin
Member 745530620-Sep-10 10:53
Member 745530620-Sep-10 10:53 
Hello everyone,

Could someone please assist with the following problem?

I have an ecgMachine class that handles (or will) the drawing of an ECG graph onto a picture box.

I have my main form, with a picture box called ecgDisplay on it.

When the simulation starts, depending on the patient data loaded (from a file) the timer starts, and every n miliseconds I need to draw/update the picturebox.

Now my problem is this as I am still confused.

Do I a) create and pass in a picturebox object from the form to the ecg class,

or B) get an ecg object into the main form and handle drawing in there?

Any advice would be great, and to just clarify, the following is a function that will be used to actualy draw the ecg...

(ecgDisplay = the pictureBox)..


private void drawEcg()
        {
            const int scaleX = 40;
            const int scaleY = 40;
            Point ecgDisplayTopLeft = new Point(0, 0);
            Point ecgDisplayTopLeftMinus1 = new Point(-1, 0);

            int halfX = ecgDisplay.Width / 2;
            int halfY = ecgDisplay.Height / 2;
            Size size = new Size(halfX + 20, ecgDisplay.Height);

            Graphics g = ecgDisplay.CreateGraphics();
            g.TranslateTransform(halfX, halfY);
            g.ScaleTransform(scaleX, scaleY);
            g.Clear(Color.Black);
            g.ResetClip();

            float lastY = (float)Math.Sin(0);
            float y = lastY;
            Pen p = new Pen(Color.White, 0.01F);
            float stepX = 1F / scaleX;

            for (float x = 0; x < 10; x += stepX)
            {
                // code to draw the graph based on ecg data
            }
        }


Thank you
Steve
AnswerRe: where to manage my picture box control [modified] Pin
Luc Pattyn20-Sep-10 11:38
sitebuilderLuc Pattyn20-Sep-10 11:38 
QuestionWPF Database Wrapping Pin
eddieangel20-Sep-10 6:25
eddieangel20-Sep-10 6:25 
AnswerRe: WPF Database Wrapping Pin
Chris Trelawny-Ross20-Sep-10 9:19
Chris Trelawny-Ross20-Sep-10 9:19 
GeneralRe: WPF Database Wrapping Pin
eddieangel20-Sep-10 10:49
eddieangel20-Sep-10 10:49 
AnswerRe: WPF Database Wrapping Pin
Patrick Fox20-Sep-10 9:24
Patrick Fox20-Sep-10 9:24 
QuestionA question on SOAP and web services Pin
Dewald20-Sep-10 4:04
Dewald20-Sep-10 4:04 
AnswerRe: A question on SOAP and web services Pin
Pete O'Hanlon20-Sep-10 4:54
mvePete O'Hanlon20-Sep-10 4:54 
AnswerRe: A question on SOAP and web services Pin
T M Gray20-Sep-10 11:47
T M Gray20-Sep-10 11:47 
QuestionHow to find all the rectangle in point collection ? Pin
Yanshof20-Sep-10 2:50
Yanshof20-Sep-10 2:50 
AnswerRe: How to find all the rectangle in point collection ? Pin
DaveyM6920-Sep-10 4:07
professionalDaveyM6920-Sep-10 4:07 
Questionprocess.start and sc delete servicename Pin
tomorrow_ft20-Sep-10 0:53
tomorrow_ft20-Sep-10 0:53 
AnswerRe: process.start and sc delete servicename Pin
tomorrow_ft20-Sep-10 1:06
tomorrow_ft20-Sep-10 1:06 
AnswerRe: process.start and sc delete servicename Pin
Pete O'Hanlon20-Sep-10 1:09
mvePete O'Hanlon20-Sep-10 1:09 
QuestionC# Seeing Through Objects Pin
C.CoderCreator19-Sep-10 20:49
C.CoderCreator19-Sep-10 20:49 
AnswerRe: C# Seeing Through Objects Pin
#realJSOP19-Sep-10 23:44
mve#realJSOP19-Sep-10 23:44 
GeneralRe: C# Seeing Through Objects Pin
C.CoderCreator19-Sep-10 23:58
C.CoderCreator19-Sep-10 23:58 
GeneralRe: C# Seeing Through Objects Pin
Dave Kreskowiak20-Sep-10 1:56
mveDave Kreskowiak20-Sep-10 1:56 

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.