|
Hi James,
I doubt that the limitation you are encountering can be found in any programming language. Generally speaking, 80 lines of code is next to nothing, where processing time is concerned. However if you run it on a machine with a Xeon processor, ofcourse it will be executed much faster than on a machine with a 386. What I mean to say, is that it is near impossible to predict whether your app will encounter this problem on every possible hardware configuration, or whether it specifically will not encounter it on a certain configuration.
Otherwise, you could look into buffering the data lines. After all if you are creating a graph, it is obviously meant for a user to look at. If the graph plots at say 140 points (point per data line) per second, its going to be a blur for the user anyway.
You could on the other hand have your graph plot at real time speed, up until that 70 data lines / sec limit, then level off, and have it take its subsequent data from the buffer. If you like, you could just inform the user that the actual speed is in excess of x.
I hope this helps you,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hi,
I would like my users to draw line on form. How could I make my users to draw line in the form.
Any luck?
Thanks in advance,
Rams.
Be simple and Be sample.
|
|
|
|
|
See my answer below. To do that, you need to makange mouse events and control the drawing of a bitmap that you will draw the lines to.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
How to include .Net framework while building setup projects in VB.Net?
Manas
|
|
|
|
|
This should help
http://msdn2.microsoft.com/en-us/library/ms994427.aspx
|
|
|
|
|
|
Here is an example that should work. You just need a form with a picturebox. Copy the code into your project and start drawing.
Public Class Form1
Private IsDrawing As Boolean = False
Private StartPoint As Point
Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
If e.Button = Windows.Forms.MouseButtons.Left Then
IsDrawing = True
StartPoint = e.Location
End If
End Sub
Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
If IsDrawing Then
PictureBox1.CreateGraphics.DrawLine(Pens.Black, StartPoint, e.Location)
StartPoint = e.Location
End If
End Sub
Private Sub PictureBox1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseUp
IsDrawing = False
End Sub
End Class
|
|
|
|
|
The example you've been given won't work properly. Once you have drawn your image, if you move another window over it, it will disappear. This is why you shouldn't use CreateGraphics for anything except very temporary drawing.
A picturebox is a picturebox, a tool for quickly throwing a bitmap onto a form. It's not a paint program, it's not Powerpoint. If you want to draw on an image, you should draw the image yourself, in your paint handler. You should track mouse movement and mouse events, and use the Invalidate() function to force paint events, your paint event will draw your bitmap, which gets drawn to as you move the mouse.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
hi,
Could you give me the code snippet to do thin in paint event.
Be simple and Be sample.
|
|
|
|
|
Well, the paint event will just draw the image. The code you were shown is basically what I'm talking about, except you should handle mouse move for the form, and when the mouse moves, draw on a bitmap and call Invalidate(), your paint method just draws the bitmap.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Iam using VB2005 on Windows XP. In my Application
I have one child form merged with the parent form menu items.
Both the forms have Toolbar.
On load of the parent form along with the child form at runtime select at some
menu and release the menu.
This selected menu image is overlapping on the toolbar of the parent form and hides the toolbar buttons.This continues on click of each and every menu.
Please, tell me the solution for this
Rekha
|
|
|
|
|
How i can export data from grid to excel
|
|
|
|
|
you can use componentOne tools.I think these r the best tools for this.
Lxcite's Planet
... the ultimate solution
|
|
|
|
|
|
instead of inheritting button class i want to create a button in component class. in that class where i can call pen and brush to make button ?
|
|
|
|
|
dim mybutton as new Button
mybotton.Text="button"
sk.haneef@gmail.com
this is haneef
|
|
|
|
|
I don't think that you understood the question at all...
---
Year happy = new Year(2007);
|
|
|
|
|
Use the Paint event. The EventArgs contains a Graphics object that you can use for the drawing.
---
Year happy = new Year(2007);
|
|
|
|
|
Thanks for the reply.but where i will call the paint method in my component class
|
|
|
|
|
Imports System.Windows.Forms
Imports System.Drawing
Public Class FlatButton
Public Sub Onpaint()
Dim obj As Graphics
obj.DrawRectangle(New Pen(Color.DarkOliveGreen), New Rectangle(0, 0, 100, 100))
obj.FillRectangle(New SolidBrush(Color.DarkRed), New Rectangle(0, 0, 100, 100))
End Sub
This is my class .now i don't want to enter events and properties.just i want to create one outline of my button.please give me a reply. i want to make dll file of this component in one project and i want to add this button to my form.please anyone give a reply
|
|
|
|
|
anujose wrote: but where i will call the paint method in my component class
You don't. The event will be called whenever the control needs to be drawn. That is the way that you provide the code that the system uses to draw your control.
---
Year happy = new Year(2007);
|
|
|
|
|
I have a form which is a loading form. I would like it to close and remove itself from memory before the next form (Login form) LGNFRM loads.
The problem is, is that the form hides itself rather than closes as when I press ALT-TAB to change windows, the form that should have closed is till open, but you cannot access it unless you close the login form. Could anyone help?
Using VB.net 2005
In the end we're all just the same
|
|
|
|
|
Hi Dave,
I am going to assume that you want to remove the first form from memory because it uses a lot of resources itself.
In this case you have to "cheat". Make a new completely empty starting form, have its load event open your second (loading) form, and then hide itself. Then make your second form open the third one in its disposed event, and use me.dispose , instead of me.close .
Et voila.
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
vhuynh View profile
More options Dec 30 2006, 9:32 am
From: "vhuynh" <huynhthanhv...@gmail.com>
Date: Fri, 29 Dec 2006 18:32:12 -0800
I write a sale form using datagrid with it detail:
Item_Code Item_Name Quantity Price Total
HH01 ? ? ?
?
When I input item_code, I want to automatically change item_name, price, and calulate
total
Can anyone help me?
Viet, Huynh
|
|
|
|
|
Hello,
I want to add Image in MDI Form.
How it i Can do. Plz Help me.
Thanks & Regards
Form :-
Vikash Yadav
|
|
|
|