View Single Post
Old 03-29-2010, 06:48 AM   #21
ondabeach
Groupie
ondabeach doesn't litterondabeach doesn't litter
 
ondabeach's Avatar
 
Posts: 193
Karma: 192
Join Date: Apr 2009
Location: Vanuatu
Device: HTC touch Diamond, Ipaq 3115
Quote:
Originally Posted by rfog View Post
Steve, ZE is a promising program. :-)

To solve rendering speed problems most common techniques are double buffering (you can direct enable by reflection in .NET -at least in PC, I do not know if it works in CE) and background screen composing: you compose in background the next screens and brings to front via blt copy and double buffering.

The other things are less important. Other future improvement could be columns support.

I will stay tunned to test all your improvements. :-)
Hi rfog,

Yes, rendering off screen is step one for sure. I have that happening now but it hasn't made anywhere near enough of an improvement yet. I will look into blt copying and double buffering in .net CF tomorrow. Most of the commonly used .net classes etc are available in compact framework, so hopefully those graphics methods will be supported as well.

The code module that decodes an ePub's content files into 'objects' (words and pictures etc) to be rendered is already quite fast even with the battery friendly processor of the JE's. Also, due to the architecture of this module, adding support for container type elements such as tables etc is only a formality as each object to be rendered can itself contain other objects with no limit on the depth of nesting. Each object has many properties, width, height, x & y render coordinates, font and image attributes and so on.

Then I create a graphics object to render onto like this:

pageBmp = New Bitmap(MaxWidth, MaxHeight)
Dim e As Graphics = Graphics.FromImage(pageBmp)

Next I use the e.graphics.drawstring and e.graphics.drawimage methods to render the objects to the 'off-screen' image according to their properties.

In .net on PC everything happens at a blistering pace, so much so in fact that I will be a able to add wysiwyg editing at a later date. The limited grunt in handheld devices however means that I'm going to have to use every trick in the book to speed the rendering module up as much as possible.

I'm hoping that wrapping the rendering module into a dll will improve the performace, that and converting it from VB into C, might have to shell out $100 and buy a code converter for that though.

Feel free to send any code snippets you think might help

Cheers,

steve.
ondabeach is offline   Reply With Quote