I have a question about the Computational Geometry, C++ and Wykobi which is found at the link below. Computational Geometry, C++ and Wykobi[^] The code available with this article has a VCL graphics file named 'wykobi_graphics_vcl.hpp' for use with the IDE C++Builder from Embarcadero Technology. Are there any instructions to compile these files into a C++Builder project? Some of the files are the VC file type .inl which I am not sure how to handle. Thanks.
Austin_Cpp
Posts
-
Any Instructions to Compile Wykobi library in C++Builder? -
3D mesh Surface with C++ GDI / GDI+ / simple canvasI have searched quite a bit with no luck. Unfortunately GDI is not considered a good option for 3D programming and almost all the samples are in OpenGL or Direct3D. I really can't use OpenGL or Direct3D without major changes to my code. GDI+ almost feels obsolete with very little activity on code web sites.
-
3D mesh Surface with C++ GDI / GDI+ / simple canvasI am programming in C++. I have a lot of work that uses the GDI, GDI+ or the older canvas to display graphs and chart. I need to draw a 3D mesh surface using these tools. Is there any sample code using these draw tools?
-
Help calculating a perpendicular line end point.To Yang Kok Wah I tested your solution and it works very well. Thank You
-
Help calculating a perpendicular line end point.I am working in C++. I am trying to draw a perpendicular hash mark from the start of a sloped line. My code below draws a perpendicular line but when the slope of the original line changes the hash mark appears to change length. When the line is close to horizontal the hash mark looks longest and shortest when the line is close to vertical. I believe the problem is the fixed value for HashLength. Can you show a better way to calculate the end of the perpendicular line(px2,py2) so my hash mark always looks the same size.
//(x1,y1)(x2,y2) //original Line
//(x1,y1)(px1,px2) //Perpendicular LineOrig_Line_Slope = (y1-y2)/(x1-x2);
Recipical_Slope = ((1.0 / Orig_Line_Slope)*-1);HashLength = 10.0;
px2 = (x1+HashLength);
py2 = (y1+(Orig_Line_Slope*HashLength));MoveToEx(hdc, x1, y1, NULL);
LineTo(hdc, px2, py2 ); -
How to convert .WAV to .CSV and .CSV to .WAVHere is the only code I can find for writing a .Wav file. This is python which I know nothing about. I have .csv files of data that when plotted draw a mandala. I want to save the same file to a .wav format so I can play the mandala as sound. Is writing a wav file possible with C++ code or do I need a library? https://gist.github.com/Pretz/1773870 #!/usr/bin/python import wave import numpy import struct import sys import csv from scikits.samplerate import resample def write_wav(data, filename, framerate, amplitude): wavfile = wave.open(filename, "w") nchannels = 1 sampwidth = 2 framerate = framerate nframes = len(data) comptype = "NONE" compname = "not compressed" wavfile.setparams((nchannels, sampwidth, framerate, nframes, comptype, compname)) print("Please be patient whilst the file is written") frames = [] for s in data: mul = int(s * amplitude) # print "s: %f mul: %d" % (s, mul) frames.append(struct.pack('h', mul)) # frames = (struct.pack('h', int(s*self.amp)) for s in sine_list) frames = ''.join(frames) for x in xrange(0, 7200): wavfile.writeframes(frames) wavfile.close() print("%s written" %(filename)) if __name__ == "__main__": if len(sys.argv) <= 1: print "You must supply a filename to generate" exit(-1) for fname in sys.argv[1:]: data = [] for time, value in csv.reader(open(fname, 'U'), delimiter=','): try: data.append(float(value)) except ValueError: pass # Just skip it print "Generating wave file from %d samples" % (len(data),) arr = numpy.array(data) # Normalize data arr /= numpy.max(numpy.abs(data)) filename_head, extension = fname.rsplit(".", 1) # Resample normalized data to 44.1 kHz target_samplerate = 44100 sampled = resample(arr, target_samplerate/100000.0, 'sinc_best') write_wav(sampled, filename_head + ".wav", 100000, 32700)
-
How to convert .WAV to .CSV and .CSV to .WAVI am looking for c++ code that can load a .wav audio file and output a .csv text file. Then convert it back again. That is wav-to-csv and csv-to-wav. This is an unusual conversion process so any help is welcome.
-
Needed: Printing Tutorial for GDI+ screen to Single PageI have been surprised how difficult it is to print a GDI+ screen as a rescaled fit-to-page. I will go back to google but I have not yet found any c++ code to do this.
-
Needed: Printing Tutorial for GDI+ screen to Single PageI am using C++ and GDI+. I am drawing 2D diagrams. I am using the standard lines, ellipse, rotation transformations and Fonts. I need to scale the print so the screen image fills a single page. I need to avoid pixilation, the print should retain the curved lines and curves in the font. The GDI+ print tutorials I am finding are very basic. Can someone point me to a GDI+ printing tutorial that shows this type of scaled printing. Thanks Larry