The above draws an arc properly, but it's not anti-aliased. Any idea how to calculate where to draw pixels (and of what opacity) to do anti-aliasing?
Type: Posts; User: 6tr6tr
The above draws an arc properly, but it's not anti-aliased. Any idea how to calculate where to draw pixels (and of what opacity) to do anti-aliasing?
Found one on wikipedia that works really well! (I altered it slightly)
function drawCircle( xMidPoint, yMidPoint, radius)
{
var f = 1 - radius;
var ddF_x = 1;
var ddF_y = -2 * radius;...
Thanks for posting that but for some reason, the arc (or circle) dissapears as it nears the left and right extremes. Any idea why and how to adjust that? The top and bottom show perfectly.
I'm trying to find an algorithm for drawing an arc but have been unable to find one (most simply use existing libraries). Does anyone know where I might look for some sample code to play with? (And...
Yeah, I thought that sizeof() would be the same for a malloc'd array and a char[] array.
Thanks guys!
Inside a function, I create a char array which I pass to a library function that fills it with a value. I then pass this back to the caller. When I do it by creating an array with malloc (and then...
Inside a function, I create a char array which I pass to a library function that fills it with a value. I then pass this back to the caller. When I do it by creating an array with malloc (and then...
Why is this not working when called in a function?
This does NOT work (see next code section for one that does work):
int getString(usb_device_handle* h, int index, char* buff)
{
...
Thanks guys! It's really just for learning/fun purposes. :) I ended up going with SnoopyPro.
How do i grab all the messages sent to and from a USB port?
I'm looking to get the position of the mouse on the screen. I'm hoping that there's one library that all linux distros use (so i don't have to worry about bundling/requiring any external libraries...
Thanks, I'll look that up.
What I am doing is figuring out which "diff" is less and then making that be the number of steps.
I have a canvas with something at a point and when the user enters in a new point, to move it to there. The issue is that i want to move it "evenly" and smoothly.
If abs( x - newX ) == abs( y -...
As best I can gather from the code:
unsigned4 = unsigned int
signed2 = signed short int
I know this code is completely valid but in the interest of learning, how would I achieve the same thing as below using bitwise operations on the unsigned4 value instead of the union "trick"?
...
One question:
when constructing the last byte, why is it "& 15" and not "& 255"? Aren't we constructing an 8-bit byte? Or is it that it won't matter, it's the same thing since everything moving in...
THANK YOU! That was a fantastic explanation!
I was pretty close to figuring it out but what threw me off was the second line where the byte is "and"-ed with 3: (tagSize[1] & 3). I was reading that...
I am working with a file that has a header with the size of the file encoded into 4 bytes like:
I have found someone's code that puts this together into the integer value, but i don't...
I was able to solve this by also installing the older c++ libs (libstdc++5 files). This allowed it to compile but now it says there may be a conflict with 6! Any idea what the risks are?
I did that and now it says:
warning: libstdc++.so.5, needed by /home/MyName/development/VXML/ext/lib/libxerces-c.so.23, not found (try using -rpath or -rpath-link)
How do I resolve that? I know...
It's constructed by an environment variable. But when I change that, it still gives the error.
I'm compiling some code and it has a bunch of "undefined reference" due to the error:
warning: libxerces-c.so.23, needed by build/i386-linux/debug/lib/libVXID.so, not found (try using -rpath or...
So is this the correct code? I added typename in two places:
template <class T> static void ensureCapacity(std::basic_string<T>& buffer,
...
I'm trying to build some 3rd party code and I'm getting an error:
ValueToString.cpp:70: error: ‘std::basic_string::size_type’ is not a type
The offending code:
template <class T> static...