Re: Speed of C# and GDI+
From: Kartal (keturkarslan_at_hotmail.com)
Date: 05/07/04
- Next message: Peter Foot [MVP]: "Re: Transfer access tables from desktop to device and vice versa"
- Previous message: Graeme Anderson: "Draw Bitmap on Panel - How to?"
- Maybe in reply to: A.B.: "Re: Speed of C# and GDI+"
- Next in thread: PPC JK: "Re: Speed of C# and GDI+"
- Reply: PPC JK: "Re: Speed of C# and GDI+"
- Messages sorted by: [ date ] [ thread ]
Date: 7 May 2004 03:43:34 -0700
Hi Mateusz,
.NET CF compiler generates MSIL code which is a CPU independent
intermediate code. .NET CF converts MSIL code to appropriate machine
code when managed method executed for the first time. However this
conversion does not cause a very big performance issue for most of the
applications. At the end you are actually running the machine code,
.NET CF is not an interpreter. However .NET CF is a framework between
the operating system and your application. I can neglect the overhead
of that the framework layer but it may not be acceptable for your
applcation.
I would suggest you to develop two small test applications and measure
the performance between.
I prefer .NET CF as it abstracts the hardware differences and
eliminates problems such as byte alignment etc. So you do not need to
test on different platforms and single code runs PPC 2003 and PPC
2002. Designing the UI and implementing the application is also very
simple.
If it is acceptable to draw the screen after completing all the
processing and drawing, there is also third option.
You can do all you geometry processing in an eVC++ dll.
Within that DLL you can paint everything to a memory DC.
.NET CF classes does not expose a bitmap handle or window handle
which you can use from the unmanaged (eVC++) code. However the Bitmap
class provides a constructor which takes a stream parameter.
You can call your eVC++ dll and query the size of the bitmap as if
it was going to written to a file. With the returned value you can
create a byte array in your .NET CF code and call unmanaged dll again
with this array as the parameter.
In your eVC++ code you can fill this array with your result bitmap
which you can extract from memory DC. You can refer to codes on how to
write a bitmap to a file. The array should contain the same info in
the same order.
When your function returns with the filled array you can create a
memory stream out of it and use that stream as a parameter to bitmap
constructor.
This technique will work faster than you first scenario and eliminates
your performance concerns as the processing and drawing will be done
on the unmanaged code.
Ercan
keturkarslan at hotmail dot com
- Next message: Peter Foot [MVP]: "Re: Transfer access tables from desktop to device and vice versa"
- Previous message: Graeme Anderson: "Draw Bitmap on Panel - How to?"
- Maybe in reply to: A.B.: "Re: Speed of C# and GDI+"
- Next in thread: PPC JK: "Re: Speed of C# and GDI+"
- Reply: PPC JK: "Re: Speed of C# and GDI+"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|