Page 1 of 1

gflDrawRectangleColor

Posted: Fri Aug 25, 2006 8:20 pm
by Infobound
I am trying to use the gflDrawRectangleColor function in visual basic 6.

In the help file it states that the line color and the fill color are "Pointer of a GFL_COLOR structure". No I created and setup a gfl_color object and passed but I get a "Type mismatch" on the color objects.

I have tried using &H codes and just plain numbers and both of those crash. The only combo that works is setting both line and fill to 0 (zero) but that basically does nothing but it does not fail.

Can someone please help?

Here is my code:

Code: Select all

    Dim LineColor As GFL_COLOR
    
    PosX = 45
    PosY = 795
    PosW = 210
    PosH = 100
    
    LineColor.Red = 0
    LineColor.Green = 0
    LineColor.Blue = 0
    Error = gflDrawRectangleColor(GflBitmap, PosX, PosY, PosW, PosH, 0, 2, LineColor, GFL_LINE_STYLE_SOLID, PtrBitmap)

Re: gflDrawRectangleColor

Posted: Wed Aug 30, 2006 9:48 am
by xnview
Infobound wrote:I am trying to use the gflDrawRectangleColor function in visual basic 6.

In the help file it states that the line color and the fill color are "Pointer of a GFL_COLOR structure". No I created and setup a gfl_color object and passed but I get a "Type mismatch" on the color objects.

I have tried using &H codes and just plain numbers and both of those crash. The only combo that works is setting both line and fill to 0 (zero) but that basically does nothing but it does not fail.

Can someone please help?

Here is my code:

Code: Select all

    Dim LineColor As GFL_COLOR
    
    PosX = 45
    PosY = 795
    PosW = 210
    PosH = 100
    
    LineColor.Red = 0
    LineColor.Green = 0
    LineColor.Blue = 0
    Error = gflDrawRectangleColor(GflBitmap, PosX, PosY, PosW, PosH, 0, 2, LineColor, GFL_LINE_STYLE_SOLID, PtrBitmap)
Ok, there is a problem in the declaration, the good one is:

Code: Select all

Public Declare Function gflDrawRectangleColor Lib "libgfle254.dll" (ByRef src As GFL_BITMAP, ByVal X0 As Long, ByVal Y0 As Long, ByVal Width As Long, ByVal Height As Long, ByRef fill_color As GFL_COLOR, ByVal line_width As Long, ByRef line_color As GFL_COLOR, ByVal line_style As Long, ByRef Dst As Long) As Integer