Sign in to follow this  

Delphi-7 and delphix (directx draw): ploting pixels issue

This topic is 2121 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I use delphi 7 and delphix so I can have ddraw and be able to create a surface to play with pixels.

so in a button trigger i use this:

for i:=1 to 100 do
for j:=1 to 100 do
dxdraw1.Surface.Pixels[i,j]:=250;

where dxdraw1 is a ddraw object, a surface.

The problem is that it works, but the result shows after I hoover another window above my program, like it is not updating the rectangle area with the pixels.
(I press the button, the cpu usage is getting up for a short and the rectangle remains black until I hoover another window.)

Also its slow, as I read somewhere else:

"...
DXDraw.Surface.Canvas.Pixels[X,Y]:=clBlue;
DXDraw.Surface.Canvas.Release;
..."

for using do play with pixels, and after another said this:

"... Just remember that this function (above) is extremely slow . It's locking and unlocking the surface on every pixel set.. not very usable. PixelDX and turboPixel don't, you manually lock the surface, do all of your pixel operations and then unlock it.. 1000 times faster. ..."

How to use these functions? I cant find them (and I have no idea since I am beginner on ddraw)? How to lock first and then unlock?

Share this post


Link to post
Share on other sites

This topic is 2121 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this