From: Luc Moulinier on
Hello !

I was wondering if someone had ever made a win32 function (in C)
equivalent to the xlib XDrawImageString ?
If so, it would be just wondrful if you could give it to me !!

Many thanks !!

Luc Moulinier
From: dgwin32 on
In the Windows SDK the DrawTextEx function draws formatted text in the
specified rectangle.

int DrawTextEx
(
HDC hdc, // handle to device context
LPTSTR lpchText, // pointer to string to draw
int cchText, // length of string to draw
LPRECT lprc, // pointer to rectangle coordinates
UINT dwDTFormat, // formatting options
LPDRAWTEXTPARAMS lpDTParams // pointer to structure for more options
);


"Luc Moulinier" <moumou(a)igbmc.u-strasbg.fr> wrote in message
news:93cc0720-0e41-4e74-9398-89ed8814265a(a)b35g2000yqi.googlegroups.com...
> Hello !
>
> I was wondering if someone had ever made a win32 function (in C)
> equivalent to the xlib XDrawImageString ?
> If so, it would be just wondrful if you could give it to me !!
>
> Many thanks !!
>
> Luc Moulinier



--- news://freenews.netfront.net/ - complaints: news(a)netfront.net ---
From: Jongware on
On 25-Jun-10 20:56 PM, dgwin32 wrote:
> "Luc Moulinier"<moumou(a)igbmc.u-strasbg.fr> wrote in message
> news:93cc0720-0e41-4e74-9398-89ed8814265a(a)b35g2000yqi.googlegroups.com...
>> Hello !
>>
>> I was wondering if someone had ever made a win32 function (in C)
>> equivalent to the xlib XDrawImageString ?
>> If so, it would be just wondrful if you could give it to me !!

> In the Windows SDK the DrawTextEx function draws formatted text in the
> specified rectangle.
>
> int DrawTextEx
> (
> HDC hdc, // handle to device context
> LPTSTR lpchText, // pointer to string to draw
> int cchText, // length of string to draw
> LPRECT lprc, // pointer to rectangle coordinates
> UINT dwDTFormat, // formatting options
> LPDRAWTEXTPARAMS lpDTParams // pointer to structure for more options
> );

(Top-posting fixed)

Additionally, use SetBkMode (hdc, OPAQUE) and SetBkColor (hdc, COLORREF)
to set the actual background color.

XDrawString appears to always draw transparently, and XDrawImageString
always opaque; on Windows, you can specifically set the BkMode and
color, which aree used the same for just about all text drawing
functions. DrawTextEx has the advantage it also can *fill* the entire
drawing rectangle, so you know what you get in advance. The other
functions use the font information to calculate a reasonable bounding box.

[Jw]