Addline is not available in skpath in skiasharp - asp.net-core

In core platform ,i am using SKPATH instead of GRAPHICSPATH(SYSTEM.DRAWING) but i cant add the line in the SKPATH.`
Path.AddLine(x,y) //Addline is showing error where path refers to the SKPATH
Is there any other alternative solution for adding the line in the SKPATH.
Thanks,

SkiaSharp sometimes uses a few different terms. What you want is probably:
var path = new SKPath();
// start the path somewhere
path.MoveTo(0, 0);
// draw a line from (0,0) to (10,0)
path.LineTo(10, 0);
// draw another line from (10,0) to (10,10)
path.LineTo(10,10);
There are a few other members, but they basically follow a pattern of AddXXX for closed shapes (eg AddRect, AddOval), and XXXTo for line segments (eg LineTo, ArcTo).

Related

CKEditor 5 inline widget -> add space before

I wrote and using my custom CKeditor5 plugin. It is an inline-widget according to their docs.
As you see on the screenshot, the widget is directly next to the . of the line before.
Is it somehow possible to add a space before the inline-widget on creation when the previous character is not a space?
I am using editor.model.change( writer => editor.model.insertContent to insert the widget.
But from there I have no cursorposition or whatsoever to find out what the previous character is.

Halcon - Move XLD line

I have a Iconic variable BackWallBoundaryLineXLD
It containts 2 points and the line connecting them.
I would need to move this line upwards 40 pixels, so basically change the row coordinate of the line to Currentvalue-40.
Is there a simple and clean way to do it, or do I have to extract the points first, edit them and then draw a new line?
Try
hom_mat2d_identity (HomMat2DIdentity)
hom_mat2d_translate (HomMat2DIdentity, -40, 0, HomMat2DTranslate)
affine_trans_contour_xld (BackWallBoundaryLineXLD, BackWallBoundaryLineXLDTranslated, HomMat2DTranslate)
Try using affine_trans_contour_xld(). You will have to setup a HomMat3D first that specifies your 40pixel translation.

Qt3D Billboards: how to make plane always face to camera

I try to use camera's viewVector to make plane face to camera, but it will turn Clockwise or Counterclockwise when Camera rotate to left or right.
Can I make the plane always face to camera without turning Clockwise or Counterclockwise?
I think camera->upVector() can help me maybe, but I don't how to use.
My code :
class planeTransformClass : public Qt3DCore::QTransform {
public:
planeTransformClass( Qt3DCore::QNode *entity = nullptr ) :Qt3DCore::QTransform(entity) {}
signals:
void faceTo( QVector3D v ) {
setRotation(QQuaternion::rotationTo(QVector3D(0,1,0), -v));
} ;
};
// Background
Qt3DCore::QEntity *planeEntity = new Qt3DCore::QEntity(rootEntity);
Qt3DExtras::QPlaneMesh *planeMesh = new Qt3DExtras::QPlaneMesh(planeEntity);
planeMesh->setHeight(2);
planeMesh->setWidth(2);
Qt3DExtras::QTextureMaterial planeMaterial = new Qt3DExtras::QTextureMaterial(planeEntity);
Qt3DRender::QTexture2D *planeTexture = new Qt3DRender::QTexture2D(planeMaterial);
FlippedTextureImage *planeTextureImage = new FlippedTextureImage(planeTexture);
planeTextureImage->setSize(QSize(3000, 3000));
planeTexture->addTextureImage(planeTextureImage);
planeMaterial->setTexture(planeTexture);
planeMaterial->setAlphaBlendingEnabled(true);
// Transform
planeTransformClass planeTransform = new planeTransformClass(planeEntity);
planeTransform->setRotationX(90);
planeTransform->setTranslation(QVector3D(2, 0, 0));
planeEntity->addComponent(planeMesh);
planeEntity->addComponent(planeMaterial);
planeEntity->addComponent(planeTransform);
// connect camera's viewVectorChanged
camera->connect( camera, &Qt3DRender::QCamera::viewVectorChanged,
planeTransform, &planeTransformClass::faceTo);
Solution using geometry shader
There is already a C++ translation this QML code that I tried to translate (using geometry shader):
https://github.com/ismailsunni/qt3d-custom-shader
My own translation can be found here. It works now after solving the issues mentioned in this question.
Solution without geometry shader
I got a different version running based on this bug report. You can find my implementation on GitHub. The billboards don't change their size when the camera moves, i.e. become smaller and larger on screen like every other object, but I hope you can work with that.
On the master branch the images also move for some reason as can be seen in this image:
The no_instanced_rendering branch doesn't use instanced rendering and displays everything correctly.
Edit
I'm sorry I'm not using your example but I don't have time anymore to adjust it. Check out the patch related to the bug report I mentioned. The person implemented a material with this effect, you should be able to extract it and make it run.

React Native Expo QRcode generate each rectangle with BorderRadius

I'm using the react-native-qrcode-svg package, but when I try to implement a simple QR code, this image returns.
I already tried removing all the styles, but keep returning the same image,
this is the code that i am using
<QRCode value="http://awesome.link.qr"/>
UPDATE
I was reviewing the code of the package and I noticed that it uses the Path to draw each box, check in the documentation and for some reason it has the property by default
strokeLinecap={'square'}
I had to specify that it was square, I also had to modify the width and height of each square, because they are poorly positioned.
I did that in the file
./node_modules/react-native-qrcode-svg/src/transformMAtrixIntoPath.js
I really don't know if I did it right, or there is another way much easier to solve, but for the moment that solved it
For someone who has the same problem, I fixed it like this:
ADD strokeLinecap={'square'} on Line 141, as property of at index.js file
Head to tranformMatrixIntoPath.js file and modify the algorithm
UPDATE Line 2 add const cellSize = size / matrix.length - 0.1
UPDATE Line 9 add path += 'M${cellSize * j + 9} ${cellSize / 2 + cellSize * i}'

How to make jedit file-dropdown to display absolute path (not filename followed by directory)?

All is in the title.
If a have opened the three files:
/some/relatively/long/path/dir1/file_a
/some/relatively/long/path/dir1/file_b
/some/relatively/long/path/dir2/file_a
The file dropdown contains:
file_a (/some/relatively/long/path/dir1)
file_a (/some/relatively/long/path/dir2)
file_b (/some/relatively/long/path/dir1)
And that bother me because I have to look on the right to differentiate the two file_a, and on the left for the others. This happens a lot to me mostly because I code in python, and thus I often have several __init__.py files opened.
How do I get jedit to display
/some/relatively/long/path/dir1/file_a
/some/relatively/long/path/dir1/file_b
/some/relatively/long/path/dir2/file_a
config:
jedit 5.1.0
java 1.6.0_26
mac osx 10.6
Unfortunately this is not easily possible currently, I just had a look at the source and this is not configurable.
You can:
Submit a Feature Request to make this configurable (good idea in any case)
Create or let create a startup macro that
registers an EBComponent with the EditBus that listens for new EditPanes getting created
retrieve the BufferSwitcher from the EditPane
retrieve the ListCellRenderer from the BufferSwitcher
set a new ListCellRenderer to the BufferSwitcher that first calls the retrieved ListCellRenderer and then additionally sets the text to value.getPath()
Try the Buffer List plugin as to whether it maybe suits your needs
Now follows code that implements the work-part of option two, runnable as BeanShell code which does this manipulation for the current edit pane. The third line is not necessary when done in an EBComponent, this is just that the on-the-fly manipulation is shown immediately.
r = editPane.getBufferSwitcher().getRenderer();
editPane.getBufferSwitcher().setRenderer(
new ListCellRenderer() {
public Component getListCellRendererComponent(list, value, index, isSelected, cellHasFocus) {
rc = r.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
rc.setText(value.getPath());
return rc;
}
});
editPane.repaint();