VS 2010 Picturebox Redrawing Get Slower And Slower

May 5, 2011

VB2010: All, I am using a picturebox to show the constellation of GPS satellites, that starts out OK. I have to redraw every now and then, because if a dialog box gets drawn on top of it, the data doesn't refresh after the dialog box is closed. Same with moving the Frame around the screen, I have to redraw the picturebox. (not sure why, but I can live with that) When I first start the program and received data from the receivers and plot the Constellation the refresh/redraw is very quick, (just a flicker) then after about 30 mins or so the refresh seems to redraw the picturebox slower and slower. I can see the individual satellites (fillellipse) redraw.

Also, I have moved the picturebox into a TAB-frame. Even when I switch from on Tab to another, the picturebox will not refresh automatically. I have to do a clear and then replot the information.

View 10 Replies


ADVERTISEMENT

App Load Slower During First Time?

Mar 31, 2012

My c++ app (which has both managed and unmanaged dlls) loads very slow ( > 70 sec) during first time startup. After that it takes 20 sec only during startup. Why? How to make it faster always?

I tried with /Delayloading, rebase etc. It did not give much improvement. In fact after rebase it took more time. note that my app has more than 150 dlls

View 3 Replies

C# - Are Anonymous Types Slower

Dec 30, 2010

Are anonymous types slower than declarative types?

For example, does

Dim score as Double = CalculateScore()

run slower than

Dim score = CalculateScore()

Why use explicit typing if it's no slower?

View 5 Replies

Why Is Code 7 Times Slower Than VBA

Feb 29, 2012

I have spent years writing VBA code that has got increasingly complicated. For the first time, I came across the error in VBA "Out Of String Space" when dealing with a 200MB CSV file.To overcome this I copied and pasted all the code over to VB.NET, compiled changed a few errors and ran the new code. The VB.Net takes 15mins, when VBA took 3 mins.For instance,Previously, to read the contents of the CSV file in VBA I used the code,Dim whole_str As String

Open file_path for Input As #1
whole_str = Input$(LOF(1),1)
Close #1

[code].....

View 1 Replies

VB Express 2010 Slower To Compile And Run That Older Versions Of VB Express?

May 12, 2010

Is VB Express 2010 slower to compile and run that older versions of VB Express? I've installed it this weekend and it seems a little sluggish on my quad core computer with 1 gig of RAM. I have VB Express 2005 installed for my students at school and it seems to fly just fine. Those school computers are older P4s with 512k of RAM.

View 7 Replies

Filling Listbox From Ado Query Far Slower In Vb2005 Than Vb6 - Speed It Up?

Aug 3, 2009

I converted some code from vb6 to vb2005 that opens a recordset and populates a listbox
with about 8,000 names. It uses classic ado. The vb6 code does it in about 0.75 of a second, the first vb2005 code does it in about 5.5 seconds while the second vb2005 code does it in about 4.5 seconds. Is there any way to improve the vb2005 performance a fair bit more?

[Code]...

View 2 Replies

VB2008 Much Slower Than VB6 - Drawing A Small Diagram On The Screen

May 17, 2010

I'm upgrading to VB2008 from VB6 and have noticed that when drawing a small diagram on the screen it is much slower. In VB6 is is drawn 'instantly' in VB2008, 34 lines, 5 arcs and 15 text items are taking 112000,000 ticks to draw- I can see it being drawn line by line. The codes contains the code to draw the diagram and some minor calculations to determine what to draw. If I just draw 4 lines directly it takes 80,000 ticks which looks 'instant'. It looks as if the calculations are slowing it down. Is there some reason for this, is there a box I have not ticked that makes it slow?

View 7 Replies

Threaded Function Call Slower Than Calling Function Directly?

Sep 14, 2010

I have a function where I am performing a lot number of database operations inside a Sub. The operation when called directly like:ExecProcess()

takes about 11 seconds to run.However, if I create a Delegate, and call the sub using BeginInvoke(), the very same process takes over 40 seconds to execute.Here's the threaded code:

Protected del As ProcessDelegate
Protected Delegate Sub ProcessDelegate()
del = New ProcessDelegate(AddressOf SELocal.ExecJob)
Dim cb As New AsyncCallback(AddressOf Me.ExecJobComplete)
del.BeginInvoke(cb, del)

Anyone know what may cause a function to take longer inside a new thread, rather than calling directly?

View 2 Replies

COM Server Code Way Slower Than Excel VBA Code?

Sep 1, 2009

I have a client who needs Excel VBA code that produces formula values moved to VB.NET. He is in the business of providing financial analytics, in this case delivered as an Excel add-in. I have translated the VBA into VB.NET code that runs in a separate DLL. The DLL is compiled as a COM Server because, well, Excel-callable .NET UDFs have to be. So far, so good: Excel cells have "=foo(Range1, Range2, ...)", the VB.NET Com Server's UDF is called, and the cell obtains a value that matches the VBA code's value.

View 7 Replies

.net - 2-dimensional List Is Almost 1000x Slower Than 1-dimensional List?

Feb 12, 2011

Consider the following code:

Dim arr1 As New List(Of Double)
Dim arr2 As New List(Of Object)
Dim timeStart As DateTime = Now
For x As Integer = 0 To 1000000

[code]....

It involves 2 lists. The first one is 1-dimensional, the second one is 2-dimensional.The first routine (which operates on the first list) completes in about .015 seconds. The second routine (which operates on the second list), however, takes almost 10 seconds. The only difference is that the second list is 2-dimensional.Is there a way to speed this up or am I doing something wrong? I have a program that requires several 2-dimensional arrays and it's running extremely slow right now. How can I speed it up so I get the same feedback that I'd get if the lists were 1-dimensional?

View 1 Replies

Drawing Without Redrawing?

Apr 19, 2011

In a simple hang man game I am I have a a method called wrong(). In this method I increase an integer variable (wrongGuesses) by one and Panel1 is refreshed. Panel1 is the control that I am drawing the actual hangman on and in its paint event I'm using a Select Case structure to draw each part. Here is my code for the wrong() method and the Panel1 paint event.

The problem I'm having is that every time Panel1 is refreshed everything is erased and and the paint event only draws a single part (head, body, left arm, etc). I realize I could redraw the entire stick man every time, but that seems inefficient. Also, I realize that I could Invalidate() each part of the stick man and then Update(), but that I was hoping for a simpler method.

[Code]...

View 12 Replies

Prevent Form From Redrawing?

Dec 17, 2010

I am using the printform object from the powerpack, I have a form that I want to print and take up the whole page when it is printed. To do this i have to resize the form and then print it.. then take it back to the orginal size.

View 5 Replies

Redrawing A Panel Within A TabPage?

Apr 2, 2012

I have a Panel within a TabPage, which draws an arc depending on three fields that the user fills in. I've managed to get this to draw and animate correctly. However, when I switch tabs (I have 3 tabs), or sometimes alt + tab out of the program to look at the API, the Panel (with the drawn arc) clears.

Is there any way to redraw the graphics within the panel? I've tried creating a handler to draw graphics whenever a 'Panel1.Paint' event is triggered, but I'm relatively new to VB and its graphical nuances.

However, when I switch back to the panel, it has a red cross through the whole Panel and nothing is drawn, unless of course I press the button again which causes the graphics to redraw but the red cross persists.

Here's the code relevant to the reloading:

Private Sub Panel1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint
If (draw) Then
Dim mySolidPen As Pen = New Pen(Color.Black, 10)

[code]....

View 2 Replies

VS 2010 New PictureBox Located Relative To Another PictureBox

Jan 21, 2011

I am working on a small desktop form in VB 2010 and am trying to place a pictureBox with an image in it, next to another pictureBox already located on the form when the user clicks a button.

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim tool As String

[Code]....

But for some reason the newPictureBox with image from "ptext" does not show up on the form. When I specify the new Point to be something like, (50,50) instead of getting the first pictureBox coordinates, the new pictureBox shows up in the right place.

Am I using System.Drawing.Point wrong? Or is there some other error that I'm making?

View 2 Replies

Drawline Method Redrawing The Previous Line?

Nov 10, 2011

Hi, I'm using the Drawline method by capturing coordinates entered into 4 textboxes and then printing the image onto a picturebox. However, I can't get the previous line to be redrawn along with the new line that needs to be drawn. I understand that it refreshes when using the picturebox.refresh() function.

The code is:Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

[Code]...

View 6 Replies

Forms :: Does IDE Take Care Of Redrawing Of Picture Box Graphics

Apr 28, 2011

So far, I have always run applications within the IDE, using Debug Mode.If I publish an application will I have to add code to repaint Picture Box graphics?In the IDE, my Picture Box graphics never get disturbed by running some other application or minimizing my forms.

I have noticed some discussions which suggest that code is needed in the Paint Event Handler in order to redraw graphics which disappear due to minimizing the form or running another application which displays a window covering my application.

View 1 Replies

Game Programming :: Redrawing Rectangles On A Form?

Jul 30, 2008

Redrawing rectangles on a Form? I have a problem repainting my form, I'm creating a "Bouncing block" Type of game , the Ball as a PicturBox, the Bar as A Picture Box And the Breakable "Targets" as An Array of Rectangles created in my forms Paint event using "e.Graphics.FillRectangles(Brush, rectsF)". It Looks a little like this:

Top of my Form(in the MainForm class):
Dim Brush As New SolidBrush(Color.Red)
Dim rectsF() As Rectangle

[Code].....

View 1 Replies

VS 2008 Redrawing Chart When Application Is Activated?

Mar 17, 2009

I'm drawing my own charts based on values from a db. I'm drawing "directly" on the forms, so to speak. The thing is everytime the application is deactivated or if someting comes in front of the charts, the drawing dissappears. For instance, I have a contextmenu in one chart and whenever I use it there is a "hole" in the chart afterwards where the menu has been. Now I can see the reason for it, but how do I get around it?

View 2 Replies

.net - Vertical Scroll Bar Redrawing In A Datagridview With Multil-ine Cells?

Jul 15, 2011

I've been searching for a while on an answer to this problem. I have a datagridview in my vb.net app and the right most column holds multiline cells. The vertical scroll bar doesn't redraw correctly:

View 1 Replies

Interface And Graphics :: Redrawing A Textbox On A Context Menu

Oct 17, 2008

I'm working with adding some user-friendly options to a program that I've developed. A lot of these require handling painting the control myself. So far this hasn't been an issue except for this case.In a context menu, I have a text box that a user can type into. However, the context menu doesn't seem to let me input a label next to it so that the user knows what the text box is for. So, I wanted to paint the text box myself but I can't get the routine to work.I have tried to put the following code in the paint event for both the context menu and the text box itself. In the paint method for the context menu, the string and the text box show up at the top of the menu. Not 3 items down like it should. Also, I don't think the end result is truly a text box.[code]I believe that txtRect is set to the rectangle for the context menu and not for the text box itself. If you run this code, "Filter By:" should show up at the top of the context menu.

View 1 Replies

VS 2010 - PictureBox From Web (URL) [Smoothly]?

Nov 13, 2010

I have a VERY FAST comp/connection. I am looking for better code that runs smoothly. I'd also like if it fails to load something like error.jpg or something, not just staying blank. I don't know where to throw this in the code. I have only loaded 1 PictureBox on the interface, but in the end, I want to load 6-10 on one form at one time.

Imports System.IO
Imports System.Net
Imports System.Text

[code]....

View 2 Replies

VS 2010 Deleting PictureBox

May 15, 2011

I'm making a game for a school class on Visual Basic 2010. (Space Invaders for the ones that are curious) Everything was going smoothly until I ran into a little problem.

[Code]....

View 5 Replies

VS 2010 Deleting PictureBox?

Aug 29, 2010

I'm making a game for a school class on Visual Basic 2010. (Space Invaders for the ones that are curious)Everything was going smoothly until I ran nto a little problem.I shoot the missile intended to kill monsters. I use ictureBox1.Width.IntersectWith(PictureBox2.Location) or something like that to know when they intersect.

View 5 Replies

VS 2010 Image To Fit Picturebox?

Jul 5, 2010

Ok i have a bigger image than the picturebox and when i resize the picturebox half of it gets missed off. How can i get it so the image fits the picturebox exactly??

View 2 Replies

VS 2010 Map Using Picturebox And Panel?

Oct 25, 2011

I just started using Visual Basic and I'm trying to make a mapping application.

Background: I'm basically trying to make something similar, but on a very small scale, to Google Maps. A user loads an image in to an picture box which is put inside a panel(so i can scroll the image). When the user has uploaded an image(a map) i want to allow him to add Labels on where he clicks. I've already done this part except the i get the wrong coordinates when i scroll through the rest of the image. If i don't scroll, the labels get placed spot-on.

I use e.X and e.Y on an event of a mousedown on the picture box. I get the correct coordinates in relation to the picture box. But when i use these coordinates to create the labels after i have scrolled, it places them in the wrong spots. I dont know how to compensate for the scrolling.

View 7 Replies

VS 2010 Picture From Web To Picturebox?

Mar 18, 2011

I couldn't find any handles that allow this, can anyone give me a hand?I want a Picturebox to display an image through a URL.

View 3 Replies

VS 2010 PictureBox Transparent?

Apr 12, 2010

I know that this question has already been asked million of times, but until now I haven't found a WORKING way to make this to work.I've a Media Player control, and in front of it (for a logo thing), I have a PictureBox, that I want to make transparent. I've tried million of things, but couldn't get it to work.

View 31 Replies

VS 2010 Using PictureBox As Checkbox?

Jan 16, 2010

Ok im using an image as checkbox. so when i click the label next to it it will change from Uncheck image to Check image...

If checkInj.Image = My.Resources.unchecked Then
checkInj.Image = My.Resources.checked
Else

[code].....

View 2 Replies

2010 Create A Picturebox Array

Mar 8, 2011

I am just wondering how i can create a picturebox array like i could when i copied and pasted another picturebox in VB6 and it asked me if i want to add them to an array. Doing so made them code like this:

[Code]...

View 1 Replies

Keyboard Scrolling A Picturebox In VB 2010?

May 20, 2011

I am building an image processing program. As part of this, I have a picturebox, set to AutoSize.

When I load an image larger than the size of the picturebox's container the box automatically expands and shows scroll bars. This is what I want. I can scroll the picturebox using the mouse to click on these, but I would like to be able to scroll the image using the arrow keys. This poses a couple of problems:

1) finding what properties to change or events to raise when a key is pressed. It is a property of the picturbox, or a property of the container?

2) dealing with repeated scrolling while the arrow keys are held. I know I can use keydown to detect that an arrow key has been pressed, but how do I continue to scroll as long as the key is held down?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved