Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Failed DLL Call
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Failed DLL Call
Divers
Thread ID:
00761081
Message ID:
00761081
Vues:
54
Hi to all

I am using a dll (_ISource30.dll) from www.smalleranimals.com. One of the functions of this DLL is to write text on an image.

A number of parameters are passed to the function. One of them is by reference and consist of 4 values (bounding rectangle for the text). The only way according to me is to pass them as values within an array. I cant get the function to draw text. The developers assured me that it is working.

VB declare command:
Declare Function IS3DrawSmoothTextOnRGB Lib "_
ISource30.dll" Alias "_
IS3DrawSmoothTextOnRGB" ( _
ByVal pRGB As Long, _
ByVal uWidth As Long, _
ByVal uHeight As Long, _
ByVal uRowStride As Long, _
ByVal pText As String, _
ByVal pFontName As String, _
ByVal uFontHeight As Long, _
ByVal uSmoothingFactor As Long, _
ByRef pTextRect As RECT, _
ByVal uDrawFlags As Long, _
ByVal uFlags As Long, _
ByVal textColor As Long) As Boolean

C Declare
_IS3EXP_ BOOL IS3CALL _IS3DrawSmoothTextOnRGB(BYTE *pRGB,
UINT32 uWidth,
UINT32 uHeight,
UINT32 uRowStride,
const char *pText,
const char *pFontName,
UINT32 uFontHeight,
UINT32 uSmoothingFactor,
const RECT * pTextRect,
UINT32 uDrawFlags,
UINT32 uFlags,
COLORREF textColor);

Code in C
UINT w = 300;
UINT h = 400;
BYTE *p = new BYTE[w * h * 3];
memset(p, 0, w * h * 3);
RECT rc = {10,0,100,100};

IS3DrawTextOnRGB(p, w, h, w * 3, "TEST", "Arial", 80, &rc, DT_TOP, 0, RGB(255,0,0));
//IS3DrawSmoothTextOnRGB(p, w, h, w * 3, "TEST", "Arial", 80, 4, &rc, DT_TOP, 0, RGB(255,0,0));

IS3DrawRGB(dc.m_hDC, p, w, h, 0, 0, w, h, NULL);

My question:

How to create the RECT * pTextRect var.

Thanks in advance.

Willie van Schalkwyk
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform