Click here to Skip to main content
15,881,588 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hey guys,

I am new to this forum and I hope somebody can help me..
Iam developing an application, which has kind of a flowsheet functionality. The idea is the user can manipulate the objects on the picturebox on the panel. each object is just a coombination of lines. the coordinates of lines are stored in a dataset. Dataset is created on a runtime. I defined a new Class called SmartPictureBox, which is basicaly a picturebox with some drawing in it that could be draged and dropped on the PictureBox. There are as many smartPictureBoxes created on a runtime as amount of objects that are avaliable for user to draw. The coordinates of these objects are stored in another dataset, which is loaded from Access DataBase when the programm starts. When an object is dragged from SmartPictureBox to PictureBox (or lets call it FlowSheet) the coordinates of the drawing will be saved in my dataset (I create it at the runtime). I defined events like mouseMove, MouseUp, mouseDown, PaintEvent and so on for the flowsheet and everytime when one of these events is fired I redraw the whole flowsheet. And the more objects I have on my flowsheet the slower my application gets. I tried working with ArrayList and saving the data in there from dataset and getting the coordinates from arralist whenever my PaintEvent is beeing raised (and my application got much faster indeed), but in that case everytime I change my dataset structure I will have to rewrite the code.
Does anyone know another way for a better performance? Like I dont know ArrayList that have like table structure with columns names and sh*t. I need the data to be stored in the dataset to do calculations, but i need another way to draw the objects...

Thanks in advance,
lana
Posted
Comments
Sergey Alexandrovich Kryukov 22-Oct-13 11:49am    
Any code sample? Short code sample, slow operation. Could you do it?
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900