N
news
This may be a stupid question, but if I don't ask I'll never know
Ok, here it goes.... I am writing an application that renders an image in
one picturebox and a graph in another.
The image is drawn by loading a jpg into a bitmap and then setting
picturebox.image = mybitmap. Ive created my own class, inheriting from the
picturebox and overriding the OnPaint event so I can do e.Graphics.DrawImage
(this.image....). This renders correctly, without flicker and without
problems.
The problem comes with the graph... Im drawing the graph using GDI+ methods
with :-
myGraphic = PictureBox.CreateGraphics ();
myGraphic.DrawLine (....);
etc.
I do this each time I believe the graph has changed.
The problem comes when I move a popup window across the two pictureboxes...
The image renders correctly but the graph will not and the popup window
erases the graph below it.
Ideally, I'd like to render the graph in a similar way to the image but I
can't find how to draw a line in a bitmap - I could write a line drawing
function but that seems a little extreme
Can anyone help ? I think I need to render the graph into a bitmap and then,
in the OnPaint event, blit it to the screen... but how ?
Thanks for any help and sorry if this is obvious or stupid,
Todd
Ok, here it goes.... I am writing an application that renders an image in
one picturebox and a graph in another.
The image is drawn by loading a jpg into a bitmap and then setting
picturebox.image = mybitmap. Ive created my own class, inheriting from the
picturebox and overriding the OnPaint event so I can do e.Graphics.DrawImage
(this.image....). This renders correctly, without flicker and without
problems.
The problem comes with the graph... Im drawing the graph using GDI+ methods
with :-
myGraphic = PictureBox.CreateGraphics ();
myGraphic.DrawLine (....);
etc.
I do this each time I believe the graph has changed.
The problem comes when I move a popup window across the two pictureboxes...
The image renders correctly but the graph will not and the popup window
erases the graph below it.
Ideally, I'd like to render the graph in a similar way to the image but I
can't find how to draw a line in a bitmap - I could write a line drawing
function but that seems a little extreme
Can anyone help ? I think I need to render the graph into a bitmap and then,
in the OnPaint event, blit it to the screen... but how ?
Thanks for any help and sorry if this is obvious or stupid,
Todd