What's the difference between `drawFunc` and `sceneFunc` in konvajs - konvajs

I checked the Shape and the Line. They both have scensFunc, but Shape has a drawFunc parameter in constructor.
Is there difference between drawFunc and sceneFunc? Why Shape has a draw function object in constructor?

drawFunc is deprecated and renamed to sceneFunc. So just use sceneFunc.

Related

Irregular shapes in Delphi

With Delphi, using Firemonkey:
How can I get a shape like in the drawing using TShape components?
I do not want to use a bitmap.
Using a TPath component with the following path data should give you a result that's very similar to what you want:
M0,0 L100,0 C110,-5 110,-15 120,-20 L200,-20 C210,-15 210,-5 220,0 L320,0 L320,5 L0,5 Z

OpenCV/JavaCV - Fill canny contourn

I'm trying to fill the contourn with cvDrawContourns after cvFindContourns in cvCanny detection, but i'm not success in this
How can I fill the whole contourn?
Thanks
In C++, you request the function to fill the contours by passing the value CV_FILLED (which is equal to -1 if I remember correctly) to the thickness argument. This is probably the same for the Java API.

How to change the color of TCylinder in Delphi Firemonkey

I can create a Cylinder
Img: TControl3D;
Img := TCylinder.Create(nil);
however Img does not seem to have a colour property. Even when I cast it as a cylinder.
It seems to be defaulting to red. Also the object inspector does not have a colour property for cylinders either.
Each 3D shape object has MaterialSource property - use it to give your shape color/texture.
If you want to set shape material to solid colour, use TColorMaterialSource component, set color that you want, and link it to the shape's MaterialSource property.

How to get a line as a structuring element in openCv?

I have a binary image and I want to perform closing on that image with the line as structuring element.
The openCv api has a function getStructuringElement that takes the following parameters
Shape
Size
Anchor Point
I can pass CV_SHAPE_CUSTOM in the first parameter to create a new shape but where do I
pass the size and the values of my structuring element.
My line will be 10 pixels wide and 1 pixels in length basically {1,1,1,1,1,1,1,1,1,1}.
There is an old function createStructringElementEx but I don't want to use that as it involves a lot of conversion of datatype.
Is this what you want?
Size = Size(10,1)
Anchor Point = Point(-1,-1)
Got it . Thanks to the comment from Niko.
Create a matrix as
Mat line = Mat::ones(1,10,CV_8UC1);
//now apply the morphology close operation
morphologyEx(img, img, MORPH_CLOSE, line,Point(-1,-1));
This solved my problem.

UIBezierPath - array of points from path?

I have a UIBezierPath.
I wish to get an array of all the points in the path.
Is that possible?
Thanks
Shani
Neither UIBezierPath nor CGPath have a method to obtain their points. This makes sense because the paths can be created with methods that are not simple points.
As #daveMac mentions in a comment there is a work-around:
void CGPathApply (
CGPathRef path,
void *info,
CGPathApplierFunction function
);
For each element in the specified path, Quartz calls the applier function, which can examine (but not modify) the element.

Resources