0

How to draw vector rounded rectangle in Graphics32 library? Is this possible?

Not a raster, should be vector.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490

3 Answers3

2

Graphics32 is a raster image library. Its primary image type is TBitmap32 which is a raster image. It does not have vector image capabilities.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • What is a different vector image drawing library? – user3780428 Jan 08 '16 at 08:53
  • Well, I don't know. You could search online. What are you looking for especially? Google+ delphi devs group would be a better place to ask. – David Heffernan Jan 08 '16 at 08:59
  • With the latest code in the SVN it does contain vector graphic capacibilities. And even before it did, but it was far more difficult to handle as the antialiasing was solved by oversampling. This said Graphics32 is still only a raster image library and as such the vector graphics need to be rendered to a raster image on every change (like resizing). – CWBudde Apr 26 '16 at 09:45
  • @CW Perhaps you might have updated the answer to reflect these changes rather than down voting it. – David Heffernan Apr 26 '16 at 17:07
1

If you do a web search, you will find a unit called G32_Interface, with routines for drawing true type fonts, bezier curves, ellipse and rotated ellipse, rounded polygons and splines. Its author is Roman Gudchenko.

Also check this link draw antialiased rounded rectangle

Community
  • 1
  • 1
A. Fornés
  • 183
  • 1
  • 8
1

The latest code in the trunk (SVN) contains the VPR vector graphics engine. It's still somehow in a beta state, but available since several years now. With this you can draw a rounded rectangle quite easily:

uses
  GR32, GR32_Polygons, GR32_VectorUtils;

[...]
var
  Points: TArrayOfFloatPoint;
begin
  Points := RoundRect(Rect(RectLeft, RectTop, RectRight, RectBottom), Radius);
  PolyPolygonFS(MyBitmap32, Points, Color32);
end;

where RectLeft, RectTop, Radius, Color32 has to be specified by the user.

CWBudde
  • 1,783
  • 1
  • 24
  • 28