PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

GetDC

Is this function ever going to be added to edgesurface? GapiDraw has it and in order for me to switch I really need it. For drawing text.
Hi,

GDI (bitmap) surfaces are currently not implemented yet, that's the reason why GetDC isn't available. GDI surfaces are currently on our roadmap and will be implemented in a future release.

In the meantime, we recommend using pixel fonts. To generate fonts automatically, use the font maker tool.
If you do implement GetDC for RGBA surfaces do you think it would be possible to use GDI DrawString with cleartype enabled to the surface and have the transparency maintained when blitting to the screen?

Basically I'd like to use GDI Draw string so I can support all kinds of locale specific fonts, have cleartype, and also be able to draw using variably opacity.
I think the GDI font rendering for ppcs is limited to only allow antialiased support if the bit depth of the dc matches the screen which would mean you couldn't render antialised text to argb surface.

As far as I know gdi doesn't at all support text rendering with variable opacity.
Hi Indiekiduk,

I'm not sure if Pocket PC GDI supports RGBA surfaces as they are used in EDGELIB. The best option could be to use some kind of pre-rendering/caching technique to draw your fonts.
Too many important things not implemented (yet ?) in EDGELIB. After I made my own AlphaBltFast from 2 surfaces I found that GetDC not implemented too :(

Now I'am forced to write copy from HDC handle to internal memory of Surface to use TTF font. I's not so hard but...

PS. As we all know for China (50000 characters) and Japan languages it's unreal to use pre-rendered fonts.

http://en.wikipedia.org/wiki/Chinese_character#Number_of_Chinese_characters
Hi Villy,

If you create a DirectDraw surface, you should be able to write to it by quering its device context. Use E2DSurface::GetSysApiSurface and cast it to a LPDIRECTDRAWSURFACE pointer. Then call the GetDC method on it.

I hope this helps.
I fount on this forum post that on some Motorola smartphone E2DSurface::GetSysApiSurface return NULL. So I decided to make all thing with GDI manually, to prevent any problems.