Re: Hello Severian and Mike

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Severian (severian_at_chlamydia-is-not-a-flower.com)
Date: 02/16/05


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


Relevant Pages

  • Re: Algorithm for "Windows Center" and "Windows Width"
    ... y represents the output display level. ... For 16 bit pixel values, you have a potential range of 65536 values but you have only a display range of 256 values, so some manipulation must be done. ... As an extra challenge for you, I think you will find that performing this calculation for every pixel everytime the user changes the window settings will make your application run very slowly. ... identity (no rescale values or Modality LUT, ...
    (comp.protocols.dicom)
  • Re: Newbie Image Center Problem
    ... know how to pan the image to a specific pixel co-ordinates. ... image within the display window (again, ...
    (comp.graphics.apps.gimp)
  • Re: Internet Explorer Browser Display Size
    ... If the Web page is hard coded for an 800 pixel wide display (like ... www.msn.com) and your window is wider then the right part of the window ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Plasma or LCD (but not DLP))
    ... It not motion blur with some of the technologies - it's double imaging ... you will see the response time for switching the pixel. ... AND a 'problem' with the display technology. ... that if you look out of a window on a rainy day you can ...
    (uk.tech.digital-tv)
  • Re: Algorithm for "Windows Center" and "Windows Width"
    ... a typo in my example: window width should be 300 and window center 40. ... For 16 bit pixel values, you have a potential range of 65536 values but you have only a display range of 256 values, so some manipulation must be done. ... Finally the resultang y,How can i use this y to adjust W/l? ... identity (no rescale values or Modality LUT, ...
    (comp.protocols.dicom)