Re: Hello Severian and Mike
From: Severian (severian_at_chlamydia-is-not-a-flower.com)
Date: 02/16/05
- Next message: Severian: "Re: GDI Code Generation"
- Previous message: Sean: "GDI optimisation, Pens Brushes and the like"
- In reply to: Pio: "Hello Severian and Mike"
- Next in thread: Tomaz Koritnik: "Re: 4 million points"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 15 Feb 2005 19:34:42 -0500
On Mon, 14 Feb 2005 06:39:04 -0800, Pio
<Pio@discussions.microsoft.com> wrote:
[top posting fixed]
>"Severian" wrote:
>
>> On Thu, 10 Feb 2005 09:37:01 -0800, Pio
>> <Pio@discussions.microsoft.com> wrote:
>>
>> >I need continuously to draw of one to four million points by screen.
>> >I represent a point with four pixels. Each point can have a different color.
>> >NET and GDI+ are extraordinarily slow for my intention.
>> >I need one brilliant idea.
>> >thanks!!
>>
>> Create a 24-bit DIB section and modify the pixel memory yourself. Then
>> at regular intervals, display the result to the window (or the
>> intersections of the viewable area with the rectangles in the result
>> that have changed -- this will bemore to keep track of, but quicker
>> unless your updates are randomly dispersed).
>>
>> Note that your map (4M points x 4 pixels per point x 3 bytes per
>> pixel) is 48MB, so your program will run efficiently only on machines
>> with enough memory.
>>
>> You could use a single pixel per point and scale it up when
>> displaying, but you'll need to profile it to decide which method is
>> faster.
>>
>> Keep in mind that color pixels in Windows are in BGR order.
>>
>> --
>> Sev
>>
>Hello Severian and Mike, the first: thanks.
>
>Now with my Pentium IV and near a million of points, mainly I take 0 seg and
>600 milliseg to calculate the position, and 0 seg and 700 milliseg to
>create a bitmap and to show it by screen (only one pixel by point). In total
>2 seg. I need more speed.
How many points are you computing? Are they spread randomly throughout
the million points? Are you drawing only what you areas you *have* to
draw from the bitmap? Have you optimized your computations? What
functions are you using to draw.
>The position of all the points changes continuosly responding to events of
>the mouse.
>
>I had thought to use functions OpenGL better than DirectX because it is more
>multiplatform, but perhaps is better a DIB section and modify the pixel
>memory myself. Could some show code to me to do this, and to recommend some
>book where appears similar code?
>I Could improve the speed of the calculation doing this outside net?
Probably. If you're using Managed C++, try unmanaged.
>¿What is your opinion?
For the calculations, use a profiler to determine where your
calculations are spending the most time.
For the display, tell us more about how you are doing it.
-- Sev
- Next message: Severian: "Re: GDI Code Generation"
- Previous message: Sean: "GDI optimisation, Pens Brushes and the like"
- In reply to: Pio: "Hello Severian and Mike"
- Next in thread: Tomaz Koritnik: "Re: 4 million points"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|