this is my first post and I just started with the Raspberry Pi.
For my project I need to draw grid lines and decided to use ajstarks lib.
Actually it was quite easy to generate the lines but there is still one problem. I would like to draw lines with a minimum width of 1 pixel.
Is this possible with openVG?
As you can see below I use Line and Stroke functions to draw lines. In that specific case I try to draw a single line at the bottom of the HDMI display but it actually draws two rows at the bottom.
i.e. the width of the line is 2 pixels.
Changing the StrokeWidth to values below 1 just dims the line(s).
How can I create lines with a single pixel width with openVG?
Best regards,
Kai
Code: Select all
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "VG/openvg.h"
#include "VG/vgu.h"
#include "fontinfo.h"
#include "shapes.h"
int main() {
int width, height;
char s[3];
init(&width, &height); // Graphics initialization
Start(width, height); // Start the picture
Background(0, 0, 0); // Black background
Stroke(255, 255, 0, 1); // Set the stroke color
StrokeWidth(1); // Set the stroke width
Line(1, 1, 1920, 1); // define line
End(); // End the picture
fgets(s, 2, stdin); // end with [RETURN]
finish(); // Graphics cleanup
exit(0);
}