Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15564

how to Draw rounded rectangle by vb6 GDI++?Draw a triangle

$
0
0
I want to draw various shapes, I wonder if you have the simplest example. Such as five-pointed star, trapezoid, prismatic, etc.

Code:

Private Sub DrawRoundRectangle(Graphics As Long, Pen As Long, X As Long, Y As Long, Width As Long, Height As Long,

Optional RoundSize As Long = 30)
GdipDrawArcI Graphics, Pen, X, Y, RoundSize * 2, RoundSize * 2, 180, 90
GdipDrawLineI Graphics, Pen, X + RoundSize, Y, X + Width - RoundSize, Y
GdipDrawArcI Graphics, Pen, X + Width - RoundSize * 2, Y, RoundSize * 2, RoundSize * 2, 270, 90
GdipDrawLineI Graphics, Pen, X + Width, Y + RoundSize, X + Width, Y + Height - RoundSize
GdipDrawArcI Graphics, Pen, X + Width - RoundSize * 2, Y + Height - RoundSize * 2, RoundSize * 2, RoundSize * 2, 0, 90
GdipDrawLineI Graphics, Pen, X + RoundSize, Y + Height, X + Width - RoundSize, Y + Height
GdipDrawArcI Graphics, Pen, X, Y + Height - RoundSize * 2, RoundSize * 2, RoundSize * 2, 90, 90
GdipDrawLineI Graphics, Pen, X, Y + RoundSize, X, Y + Height - RoundSize
End Sub


Viewing all articles
Browse latest Browse all 15564

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>