I create a circle image form, drag and drop this image on the screen, if I drag
this circle fast to the right, the left part of the image is cut, looks to me the performance is not good as I expected, another issue is if I only create a windows form, then goto task manager, the memory usage is more than 15mb, is there any way can reduce the memory usage? 4 1554
Hi Steve,
I create a circle image form, drag and drop this image on the screen, if I drag this circle fast to the right, the left part of the image is cut, looks to me the
--> Do you mean in visual studio .net or during runtime of you application?
Cheers.
--
Regards,
Chua Wen Ching :)
"steve" wrote: I create a circle image form, drag and drop this image on the screen, if I drag this circle fast to the right, the left part of the image is cut, looks to me the performance is not good as I expected, another issue is if I only create a windows form, then goto task manager, the memory usage is more than 15mb, is there any way can reduce the memory usage?
Chua Wen,
Thanks for the quick response, this is run time application, you can create a form image(any shape) easily from C#, and run the image, part of the code as below(get from MSDN):
private void Form1_MouseDown (object sender, ystem.Windows.F orms.MouseEvent Args e)
{
int xOffset;
int yOffset;
if (e.Button == MouseButtons.Le ft)
{
xOffset = -e.X;
yOffset = -e.Y;
mouseOffset = new Point(xOffset, yOffset);
isMouseDown = true;
}
}
private void Form1_MouseMove (object sender, ystem.Windows.F orms.MouseEvent Args e)
{
if (isMouseDown)
{ Point mousePos = Control.MousePo sition;
mousePos.Offset (mouseOffset.X, mouseOffset.Y);
Location = mousePos;
}
}
private void Form1_MouseUp(o bject sender, System.Windows. Forms.MouseEven tArgs e)
{
if (e.Button == MouseButtons.Le ft)
{
isMouseDown = false;
}
}
By the way, did you aware that the memory usgae issue, as long as you create a Windows form from C#, the minimun memory usage is at least 14-15MB.
B. RGDS
Steve
Chua Wen Ching" wrote: Hi Steve,
I create a circle image form, drag and drop this image on the screen, if I drag this circle fast to the right, the left part of the image is cut, looks to me the --> Do you mean in visual studio .net or during runtime of you application?
Cheers. -- Regards, Chua Wen Ching :)
"steve" wrote:
I create a circle image form, drag and drop this image on the screen, if I drag this circle fast to the right, the left part of the image is cut, looks to me the performance is not good as I expected, another issue is if I only create a windows form, then goto task manager, the memory usage is more than 15mb, is there any way can reduce the memory usage?
Hi Steve,
Sorry for the late reply.
1) Well I tested the memory usage of a normal windows app.
Debug mode - 9.5 k
Release mode - 8.5 k
2) After running your app, i do agree:
Debug mode - 15.5k
Release mode - 14.5k
3) To improve performance, you can look into clr profiling. Maybe you can see how things can be improve.
4) You forget to include:
bool isMouseDown = false;
Point mouseOffset;
Lucky i able to cope with it. Haha!
It proves that release mode are always faster. When you develop larger apps, you will notice the difference.
How much of memory you using? It seems to be okay to me, no cutting of image.
Thanks.
--
Regards,
Chua Wen Ching :)
"steve" wrote: Chua Wen,
During the run time, you can create a image form(any shape) and testing. some of the code as below which I get from the MSDN =============== =============== ==== private void Form1_MouseDown (object sender, system.Windows. Forms.MouseEven tArgs e) { int xOffset; int yOffset; if (e.Button == MouseButtons.Le ft) { xOffset = -e.X; yOffset = -e.Y; mouseOffset = new Point(xOffset, yOffset); isMouseDown = true; } }
private void Form1_MouseMove (object sender, system.Windows. Forms.MouseEven tArgs e) { if (isMouseDown) { Point mousePos = Control.MousePo sition; mousePos.Offset (mouseOffset.X, mouseOffset.Y); Location = mousePos; } }
private void Form1_MouseUp(o bject sender, System.Windows. Forms.MouseEven tArgs e) { if (e.Button == MouseButtons.Le ft) { isMouseDown = false; } }
"Chua Wen Ching" wrote:
Hi Steve,
I create a circle image form, drag and drop this image on the screen, if I drag this circle fast to the right, the left part of the image is cut, looks to me the --> Do you mean in visual studio .net or during runtime of you application?
Cheers. -- Regards, Chua Wen Ching :)
"steve" wrote:
I create a circle image form, drag and drop this image on the screen, if I drag this circle fast to the right, the left part of the image is cut, looks to me the performance is not good as I expected, another issue is if I only create a windows form, then goto task manager, the memory usage is more than 15mb, is there any way can reduce the memory usage?
Chua Wen,
Sorry I just back from vacation and can I contact with you?
My email address is st************@ hotmail.com
B. RGDS
Steve
"Chua Wen Ching" wrote: Hi Steve,
Sorry for the late reply.
1) Well I tested the memory usage of a normal windows app.
Debug mode - 9.5 k
Release mode - 8.5 k
2) After running your app, i do agree:
Debug mode - 15.5k
Release mode - 14.5k
3) To improve performance, you can look into clr profiling. Maybe you can see how things can be improve.
4) You forget to include:
bool isMouseDown = false; Point mouseOffset;
Lucky i able to cope with it. Haha!
It proves that release mode are always faster. When you develop larger apps, you will notice the difference.
How much of memory you using? It seems to be okay to me, no cutting of image.
Thanks. -- Regards, Chua Wen Ching :)
"steve" wrote:
Chua Wen,
During the run time, you can create a image form(any shape) and testing. some of the code as below which I get from the MSDN =============== =============== ==== private void Form1_MouseDown (object sender, system.Windows. Forms.MouseEven tArgs e) { int xOffset; int yOffset; if (e.Button == MouseButtons.Le ft) { xOffset = -e.X; yOffset = -e.Y; mouseOffset = new Point(xOffset, yOffset); isMouseDown = true; } }
private void Form1_MouseMove (object sender, system.Windows. Forms.MouseEven tArgs e) { if (isMouseDown) { Point mousePos = Control.MousePo sition; mousePos.Offset (mouseOffset.X, mouseOffset.Y); Location = mousePos; } }
private void Form1_MouseUp(o bject sender, System.Windows. Forms.MouseEven tArgs e) { if (e.Button == MouseButtons.Le ft) { isMouseDown = false; } }
"Chua Wen Ching" wrote:
Hi Steve,
I create a circle image form, drag and drop this image on the screen, if I drag this circle fast to the right, the left part of the image is cut, looks to me the --> Do you mean in visual studio .net or during runtime of you application?
Cheers. -- Regards, Chua Wen Ching :)
"steve" wrote:
> I create a circle image form, drag and drop this image on the screen, if I drag > this circle fast to the right, the left part of the image is cut, looks to me the performance is not good as I expected, another issue is if I only create a windows form, then goto task manager, the memory usage is more than 15mb, is there any way can reduce the memory usage? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Brian Patterson |
last post by:
I have noticed in the book of words that hasattr works by calling getattr
and raising an exception if no such attribute exists. If I need the value
in any case, am I better off using getattr within a try statement myself, or
is there some clever implementation enhancement which makes this a bad idea?
i.e. should I prefer:
if hasattr(self,"datum"):
datum=getattr("datum")
else:
datum=None
|
by: Fred |
last post by:
Has anyone a link or any information comparing c and c++ as far as
execution speed is concerned?
Signal Processing algorithms would be welcome...
Thanks
Fred
|
by: serge |
last post by:
I have an SP that is big, huge, 700-800 lines.
I am not an expert but I need to figure out every possible way that
I can improve the performance speed of this SP.
In the next couple of weeks I will work on preparing SQL statements
that will create the tables, insert sample record and run the SP.
I would hope people will look at my SP and give me any hints on how
I can better write the SP.
|
by: teedilo |
last post by:
We have an application with a SQL Server 2000 back end that is fairly
database intensive -- lots of fairly frequent queries, inserts, updates
-- the gamut. The application does not make use of performance hogs
like cursors, but I know there are lots of ways the application could
be made more efficient database-wise. The server code is running VB6
of all things, using COM+ database interfaces. There are some
clustered and non-clustered...
|
by: Scott |
last post by:
I have a customer that had developed an Access97 application to track
their business information. The application grew significantly and
they used the Upsizing Wizard to move the tables to SQL 2000. Of
course there were no modifications made to the queries and they
noticed significant performance issues. They recently upgraded the
application to Access XP expecting the newer version to provide
performance benefits and now queries take...
| |
by: Mark Shelor |
last post by:
I've encountered a troublesome inconsistency in the C-language Perl
extension I've written for CPAN (Digest::SHA). The problem involves the
use of a static array within a performance-critical transform function.
When compiling under gcc on my big-endian PowerPC (Mac OS X),
declaring this array as "static" DECREASES the transform throughput by
around 5%. However, declaring it as "static" on gcc/Linux/Intel
INCREASES the throughput by...
|
by: bjarne |
last post by:
Willy Denoyette wrote;
> ... it
> was not the intention of StrousTrup to the achieve the level of efficiency
> of C when he invented C++, ...
Ahmmm. It was my aim to match the performance of C and I achieved that
aim very early on. See, for example "The Design and Evolution of C++".
-- Bjarne Stroustrup; http://www.research.att.com/~bs
|
by: Bern McCarty |
last post by:
I have run an experiment to try to learn some things about floating point
performance in managed C++. I am using Visual Studio
2003. I was hoping to get a feel for whether or not it would make sense to
punch out from managed code to native code (I was using
IJW) in order to do some amount of floating point work and, if so, what that
certain amount of floating point work was
approximately.
To attempt to do this I made a program that...
|
by: Michael D. Ober |
last post by:
When calling Enqueue, the internal array may need to be reallocated. My
question is by how much? In the old MFC array classes, you could tell MFC
how many additional elements to add to the array when it needed to
reallocate, which greatly boosted performance relative to adding 1 element
at a time.
Thanks,
Mike Ober.
|
by: jvn |
last post by:
I am experiencing a particular problem with performance counters.
I have created a set of classes, that uses
System.Diagnostics.PerformanceCounter to increment custom performance
counters (using .Net 2.0)
The performance counter categories have been successfully created.
When the set of classes are used by a WinForm test harness application,
they function as expected, and the performance counters can be seen to
be updated by using the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |