PathToRegion for VectorDrawing?

Just starting out? Need help? Post your questions and find answers here.
sq4
User
User
Posts: 98
Joined: Wed Feb 26, 2014 3:16 pm
Contact:

PathToRegion for VectorDrawing?

Post by sq4 »

In GDI we have the API PathToRegion_() to create a region from the drawing path: Great!
In the VectorDrawing library of PB there's no way to save a path.

Does anybody know if this is faesible in some way or another?
Some hidden PB internal(s) to access perhaps?

I am now using GDI regions in my new project (http://www.raxntrax.com/pixys2).
It works as expected, but since they are pixel based, they give some jitter when resizing/rotating... :|
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PathToRegion for VectorDrawing?

Post by IdeasVacuum »

Hi sq4

It was my understanding that the Windows version of the Vector lib is based on GdiPlus......

Have you seen these posts? Might help:

DrawVectorEx Module by Thorsten1867
Some Tips using VectorDrawing lib
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PathToRegion for VectorDrawing?

Post by IdeasVacuum »

IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
STARGÅTE
Addict
Addict
Posts: 2090
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: PathToRegion for VectorDrawing?

Post by STARGÅTE »

Isn't ClipPath what you looking for?
https://www.purebasic.com/documentation ... ppath.html
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
sq4
User
User
Posts: 98
Joined: Wed Feb 26, 2014 3:16 pm
Contact:

Re: PathToRegion for VectorDrawing?

Post by sq4 »

IdeasVacuum wrote:Hi sq4

It was my understanding that the Windows version of the Vector lib is based on GdiPlus......
Yes, I know, and that's why I asked about a PathToRegion alternative.
In the VectorDrawing lib ClipPath() clips whatever is in the drawing path.
In GDI otoh you could use SelectClipRgn_() with a previously saved GDI region.

PathSegments() / AddPathSegments() is kind of a GDI PathToRegion() alternative, but still you need to draw those in order for ClipPath() to work.
I think I have to conclude that GDI+ just doesn't support region objects... :(

Thanks for those links.
Post Reply