Hi,
I have some code I'm using in a CompactFramework project. The code works as
expected on the CF, but when using this code on the FullFramework (FF) it
does not work the way I want. It copiles ok, but the screendrawing is not
working 100%.
What the code is supposed to do:
Draw recieved values to a panel so values are displayed countiniously as a
scrolling graph.
Too do the 'scrolling' I first copy the existing bitmap from my panel and
draw it back -1 position to the left.
Then I clear the rightmost part of the panel
and finally draw the new recieved value on the newly cleared area.
It is the 'scrolling' part that is not working on FF.
Does anyone have any hints or clues on what I'm doing wrong here ? (Please
see code below)
/*From constructor
DrawBitMap = new Bitmap(DrawPanel.Width, DrawPanel.Height);
DrawGrapics = Graphics.FromImage(DrawBitMap);
*/
internal void DrawAdvancedMode(int sample)
{
int h = DrawPanel.Height;
int w = DrawPanel.Width - 1;
DrawGrapics.DrawImage(DrawBitMap, -1, 0); // scroll left. I think this
where the problem is*******
DrawGrapics.FillRegion(WhiteBrush, new Region(new Rectangle(w - 1, 0, w,
h))); // clear plot region
int y = h-(int)((double)h * ((double)sample/MAX_SAMPLE));
int x = w - 1 + i;
// plot
DrawGrapics.DrawLine(BluePen, x, y, LastPoint.X, LastPoint.Y);
DrawPanel.Invalidate();
LastPoint.X = x;
LastPoint.Y = y;
LastPoint.X -= 1;
}
Thanks for reading.
regards,
Leo