VB5 Polygon API calling ? 
Author Message
 VB5 Polygon API calling ?

Does any one have any working code which will draw a filled triangle on a
form and on the printer ?

I have been using the floodfill API after drawing the triangle with lines
but it won't work on the printer object.

I am trying unsuccessfully to utilise the polygon API
I have the 32bit declare in place but no luck in making it work.
The calling example I have is from VB3 16bit and something must have changed
?

Does anyone maybe know of another way to fill a triangle on screen and
printer ?

Many thanks in advance for any help you can provide.

------------ Regards, Phil Dorman. ------------



Sun, 26 Aug 2001 03:00:00 GMT  
 VB5 Polygon API calling ?
Check out the Form.Line and Printer.Line methods in the help files.
-[p]-


Quote:
>Does any one have any working code which will draw a filled triangle on a
>form and on the printer ?

>I have been using the floodfill API after drawing the triangle with lines
>but it won't work on the printer object.

>I am trying unsuccessfully to utilise the polygon API
>I have the 32bit declare in place but no luck in making it work.
>The calling example I have is from VB3 16bit and something must have
changed
>?

>Does anyone maybe know of another way to fill a triangle on screen and
>printer ?

>Many thanks in advance for any help you can provide.

>------------ Regards, Phil Dorman. ------------




Mon, 27 Aug 2001 03:00:00 GMT  
 VB5 Polygon API calling ?
whoops. Sorry. I had read "Rectangle" instead of "Triangle" Just ignore me.\

-[p]-


Quote:
>Does any one have any working code which will draw a filled triangle on a
>form and on the printer ?

>I have been using the floodfill API after drawing the triangle with lines
>but it won't work on the printer object.

>I am trying unsuccessfully to utilise the polygon API
>I have the 32bit declare in place but no luck in making it work.
>The calling example I have is from VB3 16bit and something must have
changed
>?

>Does anyone maybe know of another way to fill a triangle on screen and
>printer ?

>Many thanks in advance for any help you can provide.

>------------ Regards, Phil Dorman. ------------




Mon, 27 Aug 2001 03:00:00 GMT  
 VB5 Polygon API calling ?
you will need some code in a module and the bit in the form that does the
work

'###############################################################
'Module
#If Win32 Then
    Public Declare Function Polygon Lib "gdi32" (ByVal hDC As Long, lppoint
As POINTAPI, ByVal nCount As Long) As Long
#Else
    Public Declare Function Polygon Lib "gdi" (ByVal hDC As Integer,
lpPoints As POINTAPI, ByVal nCount As Integer) As Integer
#End If
#If Win32 Then
    Public Type POINTAPI
        X As Long
        Y As Long
    End Type
#Else
    Public Type POINTAPI
        X As Integer
        Y As Integer
    End Type
#End If
'#############################################################

'Form
#If Win32 Then
    Dim ret&, kbw_brush&
#Else
    Dim ret%, kbw_brush%
#End If
Dim p(1 To 3) As POINTAPI

kbw_brush = CreateSolidBrush(RGB(255, k% - 255, 0))
ret = SelectObject(form1.hDC, kbw_brush)

p(1).X = 200
p(1).Y = 100
p(2).X = 100
p(2).Y = 200
p(3).X = 300
p(3).Y = 200
ret = Polygon(form1.hDC, p(1), 3)
ret = DeleteObject(kbw_brush)

'substitute printer.hdc for form1.hdc for printer output
' or use a variable

There are various options for the brush pattern

   -**** Posted from remarQ, Discussions Start Here(tm) ****-
http://www.remarq.com/ - Host to the the World's Discussions & Usenet



Tue, 28 Aug 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. picturebox.scale command with Polyline or Polygon API Call

2. Polygon API calls.....

3. Polygon API Call...

4. polygon - polygon intersection

5. How to call "Polygon"-func??

6. Lines, Polygons and PolyBezier(?) with the API

7. help...create polygon region API

8. HELP: API Polygon Functions

9. Problems with Polygon API Function

10. Someone please help with Polygon API??

11. API-Katalog für VB5 (API-Cataloge for VB5)

12. Polygon API

 

 
Powered by phpBB® Forum Software