Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Don't forget to read Tuesday's email newsletter for your chance to win a free copy of Construct 2!


Display a bitmap as fast as technically possible!


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
25 replies to this topic

#21 Nik02   Crossbones+   -  Reputation: 2880

Like
0Likes
Like

Posted 20 February 2012 - 12:43 AM

Regarding partial surface updates:

The common need to update just specific rectangles of a graphics memory area is the specific reason why D3D Lock* and Update* methods have rectangles as parameters. It is simply more efficient to just copy the actually changed data than blindly copy it all (if you can efficiently detect the changed areas).

It isn't very difficult to detect what specific areas of a desktop have changed, and express the changed areas as lists of rectangles. If you capture and send the images within those rectangles, the combined amount of data is likely much smaller than what the full desktop image requires.

On the drawing side, only draw the data that you actually get. And if you don't have all the data that you need to fill the frame, request the full frame image (commonly known as keyframe) from the remote desktop server and track changes from that.

Niko Suni


Sponsor:

#22 David Lake   Members   -  Reputation: 118

Like
0Likes
Like

Posted 20 February 2012 - 10:55 AM

If i can calculate the difference between the current and last frame and set the alpha as well as rgb channels of the unchanged pixels to zero so the unchanged areas can be compressed out by the png compression then just lay the new frame over the last one at the other end.

#23 David Lake   Members   -  Reputation: 118

Like
0Likes
Like

Posted 21 February 2012 - 01:30 PM

I still need help with this I am trying hard but finding a way round the slow Get/SetPixel aint easy.

#24 Nik02   Crossbones+   -  Reputation: 2880

Like
0Likes
Like

Posted 21 February 2012 - 01:52 PM

Per-pixel operations are going to be slow. Use block copies for optimum performance (hint: image rectangles are rows of blocks).

Niko Suni


#25 David Lake   Members   -  Reputation: 118

Like
0Likes
Like

Posted 21 February 2012 - 05:35 PM

Ok iv somehow got my program to to about 20fps!!! the speed is insane!!! but im not quite sure how but theres 1 slight problem when i save a surface to a bmp instead of png the image is magnified and the right and bottom are cutoff what the hell is doing this?
Not only that but I was running x64, now i'm running x86 its going even faster at about 20-30fps its smooth enuf to watch a movie in!!!

#26 David Lake   Members   -  Reputation: 118

Like
0Likes
Like

Posted 22 February 2012 - 01:42 AM

I figured out why the image was being stretched I just needed to specify the dimensions when calling DrawImage!
Now hows about some help with my idea of blanking unchanged pixels to make the frames smaller what would be the code for doing this?




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS