Insert Image to a Document - c++

I am new to VC++, I want to know if it is possible to insert an image created by my kinect camera to a RTF doc or MSWord doc using VC++ in a Win32Console Application? Any pointers on how can I achieve my goal? Thanks!

Yes, it is possible. I assume that you already have a way to get the image from the camera and save it to a file. RTF (specification) is an utter pig, but the spec will tell you how to add an image. Parsing an existing file to figure out where to add the image though, or creating a new file with the image already present, is an exercise I'll leave to you.
If you have any experience with COM then adding an image to a Word document might prove easier. This MSDN page (link) will help.

Related

How to open an FBX file from my UE4 project's interface

I've created an interface for my UE4 project that has an import button. What I want it to do is to access FBX files in the user's desktop and opens the one the user selects.
I've written a c++ code that searches for FBX files in the desktop and returns their names, if found.
I'm kind of confused/stuck at this moment, and don't know exactly how to continue. My question is:
Shall I open the FBX file using c++ or blueprints?
It would be much appreciated if you could elaborate more on the approach you suggest.
Thank you
What I want it to do is to access FBX files in the user's desktop and opens the one the user selects.
"Opening something" does not actually tell us what you want to do.
Open the file with The default application for the file type?
Load the mesh somewhere into RAM?
Spawn objects in UE4 with the mesh?
Who knows what opening means. Opening the file in maya will be quite different from opening it with a hex editor.
Specify what your programm should do.
Shall I open the FBX file using c++ or blueprints?
Appart from what you can add to what I said above this questions answer will be purely subjective if BP is actually capable of doing what you want. IF you are doing good in c++ I suggest to stick with it for file operations.
Here Epics documentation on asset references, this should fit for people finding this thread and probably for you.
https://docs.unrealengine.com/latest/INT/Programming/Assets/ReferencingAssets/index.html
Just use UStaticMesh instead of the filetype used in the examples.
Here a UE4 wiki example implementation of what you could mean:
https://wiki.unrealengine.com/Dynamic_Load_Object
Shall I open the FBX file using c++ or blueprints? It would be much appreciated if you could elaborate more on the approach you suggest.
Yes, you can use the thirdparty libray to import the FBX, such as assimp
https://github.com/assimp/assimp
In the mean time, instead of use static mesh, you could use precedure mesh instead.

Converting a pdf to jpg images using in Qt

the heading says it all actually:
i want to convert a pdf file into several jpg images. This is to be a part of a software coded in c++ (I'm using Qt for my interface if that matters... :)
Preferably i want the images output to be 72 dpi.
Is there a easy way to do this?
Please comment if you need any more information form me, I'm grateful for any help, tips or answer!
Take pdf2image utility, and run it from you program, collecting its output files.
If you really need single executable (why?) — take a look at its source, and rip everything from it.
You should try to use poppler (or xpdf). You'll have full control of the rendering resolution and can take advantage of image output devices (ImageOutputDev) which will render pages to a framebuffer.Saving this framebuffer to jpeg with libjpeg is ,then , pretty straightforward.

Converting HTML file to PDF using Win32/MFC

As part of my application, my client has requested that I include an automated e-mailing system. As part of this system, I generate HTML code and use automation to send it via. Outlook.
However, they also require a PDF copy of the HTML document to be sent as an attachment. My initial attempts involved using libHaru, which proved difficult to use efficiently, as I was required to create the PDF document from scratch, which required computation of the position of each of the lines in a table, and positioning of all the text, etc.
I was wondering if there would be a way to programmatically convert HTML code (or an HTML file if need be) into a PDF document either by using Win32/MFC itself or an external library.
Thanks in advance!
EDIT: Just to clarify, I am looking for solutions which minimize external dependencies.
You should evaluate this utility wkhtmltopdf:
http://code.google.com/p/wkhtmltopdf/
You can call it from the command line without the need to run a setup.
I use it generating my output documents as html then cal a ShellExecute(...) to convert it to PDF. It's great!
Inside uses webkit + qt. So compability with modern HTML is OK.
Hope it helps.
I'd take a look at PDF Creator, which can be used as a COM object (that acts pretty much like a printer). I haven't used it to print HTML, so I'm not sure, but my guess is that you'll probably end up having to instantiate a web browser control to render the HTML, and then feed it from there to the PDF control.
Some possible answers are in this thread:
C++ Library to Convert HTML to PDF?
Not sure if they will satisfy your particular requirements, but these might at least get you started.
Edit:
Some other possible options here.
Not MFC but you can try QtWebKit. It can render and export HTML to PDF, PNG, JPEG

Add jpeg image file in Qt using C++

I am a beginner with regards to Qt. I need code to browse an image which is stored in system and add the selected image file (jpeg only) during run time.
Take a look at QFileDialog::getOpenFileName() for getting a file path to open.
EDIT
The second part of your question is not clear. There are a variety of ways to display an image in Qt. You have to be more specific.

Exporting *.png sequence from *.fla with C++

I need an animation in my program. My designer draws animation in Flash and provides me with *.fla file. All I need is to grab 30-40 PNGs from this file and store them within my internal storage.
Is it possible grab resources from *.fla with C++ ? Probably, some Adobe OLE objects can help?
Please, advice.
Thanks in advance.
If I asked an artist to make me an icon I wouldn't expect to need to write code to convert a .3DS model into a usable icon format.
You can save yourself a lot of time and hassle by having your designer use File->Export and give you PNGs of the layers and frames instead of a .FLA file if that's the format you require for your implementation.
If that's not possible for some reason then you can probably find a flash decompiler that has a command line option which you could launch from your program to extract assets as part of your loading sequence but that is generally frowned upon because this is not the intended use of the proprietary format for .swf/.fla anymore than you should design applications to extract source code from a binary executable.
Assuming
You are using CS5
The assets used internally in the FLA are already PNG's as you want them to be.
Then simply get the FLA saved as a XFL file, and you will be able to grab them from the library folder ( but then why not just get them to mail you the pngs ? )
So if for some reason you can only get access to the fla and not the designer, then you can do it programatically by renaming the fla to .zip, extracting.. and you have the XFL format.