Board index » delphi » Bitmap Refresh Win 98 OK, Win NT Not?

Bitmap Refresh Win 98 OK, Win NT Not?

I created an application which changes the contents of a small bitmap
(10 x 10 pixels) every 10th of a second. In Windows 98 this works
perfectly. However in Windows NT it seems that only one picture after
every whole second is displayed (i need a display of a clock with 1/10
seconds resolution).

Does anyone know what I can do?

Thanks for any help
Regards
Werner Nussbaumer

 

Re:Bitmap Refresh Win 98 OK, Win NT Not?


Werner Nussbaumer schrieb:

Quote

> I created an application which changes the contents of a small bitmap
> (10 x 10 pixels) every 10th of a second. In Windows 98 this works
> perfectly. However in Windows NT it seems that only one picture after
> every whole second is displayed (i need a display of a clock with 1/10
> seconds resolution).

> Does anyone know what I can do?

Give more details, this is definitely a problem with your code.

- Robert
--
Robert Ro?mair
http://home.t-online.de/home/Robert.Rossmair/

Re:Bitmap Refresh Win 98 OK, Win NT Not?


Quote
Werner Nussbaumer wrote:
> I created an application which changes the contents of a small bitmap
> (10 x 10 pixels) every 10th of a second. In Windows 98 this works
> perfectly. However in Windows NT it seems that only one picture after
> every whole second is displayed (i need a display of a clock with 1/10
> seconds resolution).

Have you tried putting an Application.ProcessMessages withing the update
routine?

Other than that you may need to post a small segment of the code to show
us what is going on.

--
Charles Hacker
Lecturer in Electronics and Computing
School of Engineering
Griffith University - Gold Coast

Re:Bitmap Refresh Win 98 OK, Win NT Not?


Here it is (called 10 times per second):

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  // Dig[] is an array of bitmaps 21x11 pixels, 16 colors
  // Windows 98 shows all bitmaps, NT only one or sometimes two
  ledDigits.picture.assign(dig[j]);
  j := j + 1;
  if j >= 10 then j := 1;
  application.processMessages;
end;
Regards
Werner Nussbaumer

Quote
Charles Hacker wrote:

> Werner Nussbaumer wrote:
> > I created an application which changes the contents of a small bitmap
> > (10 x 10 pixels) every 10th of a second. In Windows 98 this works
> > perfectly. However in Windows NT it seems that only one picture after
> > every whole second is displayed (i need a display of a clock with 1/10
> > seconds resolution).

> Have you tried putting an Application.ProcessMessages withing the update
> routine?

> Other than that you may need to post a small segment of the code to show
> us what is going on.

> --
> Charles Hacker
> Lecturer in Electronics and Computing
> School of Engineering
> Griffith University - Gold Coast

Re:Bitmap Refresh Win 98 OK, Win NT Not?


On Tue, 27 Jun 2000 09:47:35 +0100, Werner Nussbaumer

Quote
<w.nussbau...@datacomm.ch> wrote:
>Here it is (called 10 times per second):

>procedure TForm1.Timer1Timer(Sender: TObject);
>begin
>  // Dig[] is an array of bitmaps 21x11 pixels, 16 colors
>  // Windows 98 shows all bitmaps, NT only one or sometimes two
>  ledDigits.picture.assign(dig[j]);
>  j := j + 1;
>  if j >= 10 then j := 1;
>  application.processMessages;
>end;

I assume ledDigits is a TImage or similar, try stuffing a
ledDigits.Repaint; after the assign, i've experienced it helps

- Asbj?rn

Re:Bitmap Refresh Win 98 OK, Win NT Not?


Thank you for your help.

I tried this, but id didn't help. Maybe it's because of the the time
slice management in Windows NT.

Regards
Werner Nussbaumer

Quote
Lord Crc wrote:

> On Tue, 27 Jun 2000 09:47:35 +0100, Werner Nussbaumer
> <w.nussbau...@datacomm.ch> wrote:

> >Here it is (called 10 times per second):

> >procedure TForm1.Timer1Timer(Sender: TObject);
> >begin
> >  // Dig[] is an array of bitmaps 21x11 pixels, 16 colors
> >  // Windows 98 shows all bitmaps, NT only one or sometimes two
> >  ledDigits.picture.assign(dig[j]);
> >  j := j + 1;
> >  if j >= 10 then j := 1;
> >  application.processMessages;
> >end;

> I assume ledDigits is a TImage or similar, try stuffing a
> ledDigits.Repaint; after the assign, i've experienced it helps

> - Asbj?rn

Re:Bitmap Refresh Win 98 OK, Win NT Not?


On Thu, 29 Jun 2000 11:30:09 +0100, Werner Nussbaumer

Quote
<w.nussbau...@datacomm.ch> wrote:
>Thank you for your help.

>I tried this, but id didn't help. Maybe it's because of the the time
>slice management in Windows NT.

That shouldnt be it, i think its around 20ms per slice. Anyways, your
code works fine on my system, but try increasing the colors to 256 or
true color, it may be a driver thing. Also, since the update is so
small, you could consider using a TPaintBox, and in the timer to
PaintBox1.Repaint, and then handle the actuall painting it the
paintbox's OnPaint, using Canvas.Draw(0,0, dig[i]);

- Asbj?rn

Re:Bitmap Refresh Win 98 OK, Win NT Not?


Thanks very much for your help. I will have a try on this.

Regards
Werner Nussbaumer

Quote
Lord Crc wrote:

> On Thu, 29 Jun 2000 11:30:09 +0100, Werner Nussbaumer
> <w.nussbau...@datacomm.ch> wrote:

> >Thank you for your help.

> >I tried this, but id didn't help. Maybe it's because of the the time
> >slice management in Windows NT.

> That shouldnt be it, i think its around 20ms per slice. Anyways, your
> code works fine on my system, but try increasing the colors to 256 or
> true color, it may be a driver thing. Also, since the update is so
> small, you could consider using a TPaintBox, and in the timer to
> PaintBox1.Repaint, and then handle the actuall painting it the
> paintbox's OnPaint, using Canvas.Draw(0,0, dig[i]);

> - Asbj?rn

Other Threads