gflDrawRectangleColor

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: helmut, XnTriq, xnview

Post Reply
Infobound

gflDrawRectangleColor

Post 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)
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: gflDrawRectangleColor

Post 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
Pierre.
Post Reply