Re: Fill inside Polygon ???
From: Mike D Sutton (EDais_at_mvps.org)
Date: 04/04/04
- Next message: Amrit: "Re: Fill inside Polygon ???"
- Previous message: Amrit: "Fill inside Polygon ???"
- In reply to: Amrit: "Fill inside Polygon ???"
- Next in thread: Amrit: "Re: Fill inside Polygon ???"
- Reply: Amrit: "Re: Fill inside Polygon ???"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 4 Apr 2004 18:24:04 +0100
> I want to fill inside Arrow
Use the Polygon() API call rather than drawing lines and filling the inside, this is also a lot quicker so you'll notice a
considerable performance increase if drawing many shapes.
'***
Private Declare Function Polygon Lib "GDI32.dll" ( _
ByVal hDC As Long, ByRef lpPoint As PointAPI, _
ByVal nCount As Long) As Long
Private Type PointAPI
X As Long
Y As Long
End Type
Private Sub Command1_Click()
Dim ArrowPts(3) As PointAPI
ArrowPts(0).X = 20
ArrowPts(0).Y = 20
ArrowPts(1).X = 280
ArrowPts(1).Y = 30
ArrowPts(2).X = 90
ArrowPts(2).Y = 90
ArrowPts(3).X = 100
ArrowPts(3).Y = 50
Picture1.FillStyle = 2
Picture1.FillColor = vbRed
Picture1.ForeColor = vbGreen
Call Polygon(Picture1.hDC, ArrowPts(0), 4)
End Sub
'***
> But how to do it and is that possible to change scale of hatch.
You can't change the scales of the default hatch styles, however you can create your own hatch pattern brush and fill your shape
with that.
Here's an old post with an example of creating your own hatch pattern brush:
http://groups.google.co.uk/groups?selm=ud3j%23aVCEHA.2908%40TK2MSFTNGP09.phx.gbl
Hope this helps,
Mike
- Microsoft Visual Basic MVP -
E-Mail: EDais@mvps.org
WWW: http://www.mvps.org/EDais/
- Next message: Amrit: "Re: Fill inside Polygon ???"
- Previous message: Amrit: "Fill inside Polygon ???"
- In reply to: Amrit: "Fill inside Polygon ???"
- Next in thread: Amrit: "Re: Fill inside Polygon ???"
- Reply: Amrit: "Re: Fill inside Polygon ???"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|