Passing in-memory bitmap to Powerpoint using wxAutomationObject? - c++

I want to insert pictures in a PowerPoint slide. I've saved bitmap to the disk and called Add_Picture to insert picture, it is working properly.
What I want is without saving bitmap to the disk, add a picture in a PowerPoint slide.
Currently, i'm passing the picture to the clipboard and called the method Paste to do that.
Is there any better alternative solutions?

Did you look at the OLE Automation?
Keep in mind though that this solution will not be portable - Windows only.

Related

Qt rendering an image and showing it

I have a small app that renders an image. It's in .ppm format and opens nicely in Mac's Xee image viewer. The image is created in the default project folder.
However, the user doesn't know where the image is after it is rendered and I would like to open it automatically or perhaps offer where to save the image before it is created.
That is the first problem. The second problem is .ppm - it's not opened by default on Windows, you need Irfan Viewer or something alike.
Is there a way to solve both those problems easily in Qt? For instance, the image is created where the user wants and my app displays it in that ppm format without using some other software? And If a user wants to reopen the image, I should probably make it possible, as well.
I am not a Qt, nor a C++ developer so I am struggling a bit with this, but I have to do it.
Thanks in advance for the tips and advices.
If you convert your image to a QImage (if it's not one already), you can specify where and in what format to save it when calling the QImage::save method.

MFC ribbon large images resource on multiple rows

I'm working on a ribbon application and I need lots of icons for each category. If I put all the images for the category on the same row it becomes too wide, i.e. difficult for maintainance when I need to add/edit something. So my question is: is there a way to put the images on several rows? Thanks!
There is no way to put images on several rows.
The toolbar mode to manipulate tiles of the bitmaps isn't available on demand.
I use a different tool to manage such bitmaps (i.E. Axialis)
Axialis Icon Workshop is a good choice. Try to get the free version somewhere: It has everything you need for ribbon icons, including good alpha channel handling.
If you really insist on using smaller bitmaps, you could use an alternative constructor to associate icons to your UI elements:
CMFCToolBarImages smallerIconGroup; // load some bitmap ressource into this object
...
CMFCRibbonButtonEx myButton = new CMFCRibbonButtonEx(ID_MYCOMMAND, _T("My Button"), smallerIconGroup.ExtractIcon(0));
OK, I saw Axialis. It looks good, but for now I'm sticking to Gimp :D If I see the icons are too much, I'll check the portable version.

Qt scrolling a large image

I need to implement a simple sound editor with a specific signal processing function.
I want to display the sound information vertically as a large picture - 1024 x [large height].
So I'm looking for Qt's best way to implement low-cpu-consuming vertical scrolling similar to web-browsers scrolling.
You need to create a custom widget by overriding it's paintEvent().
Have a look at this self-explanatory example on how to create a following widget.
A normal QScrollArea will give you what you want 99% of the time. But you're wanting to create a bitmap of potentially massive size, and you want to store it in RAM - you will quickly run out of space.
You are probably going to need a need a system where you save the image to file, and use the scroll area's bounds to intelligently load it's contents from the file (and a certain size around it to make it smooth) - Qt does not provide this. This is hardly groundbreaking stuff, so a web search for "scrolling very large images" or something similar should give a smart result.
If your intention is to plot STFT data, then you can easily adopt one of the widgets in the QWT library:
http://qwt.sourceforge.net/
Anyway, take a look at it, it is a great source of inspiration and the code is available...

Rich Text Editor Recommendation - Needs support for image upload and resizing

I am looking for WYSIWYG rich text editor to use with Django. I've looked at a number of different editors (CKEditor, TinyMCE, Aloha, YUI), but I can't seem to find one that has one necessary feature: dynamic image resizing.
What I mean by that is the ability to click a corner of the image in the editor and drag your mouse to resize the image. Content around the image should then adapt to the new image size. As well, the editor needs to have image upload functionality.
Any recommendations?
It's fine if its an editor+plugin combo. Ideally it would also integrate nicely with Django.
Thanks for the help!
Yup. I came to the same conclusion too. django-ckeditor is really easy to use.
Froala and Redactor are perfect for your case. They're paid though.
QuillJS is a free alternative that allows image manipulations by inserting the image directly as a base64 encoded string.

Screen capture of MDI app with OpenGL graphics using MFC

In our MDI application - which is written in MFC - we have a function to save a screenshot of the MDI client area to file. We are currently doing a BitBlt from the screen into a bitmap, which is then saved. The problem is that some of the MDI child windows have their content rendered by OpenGL, and in the destination bitmap these areas show up as blank or garbled.
I have considered some alternatives:
- Extract the OpenGL content directly (using glReadPixels), and draw this to the relevant portions of the screen bitmap.
- Simulate an ALT+PrtScr, since doing this manually seems to get the content just fine. This will trash the clipboard content, though.
- Try working with the DWM. Appart from Vista and Win7, this also needs to work on Win2000 and XP, so this probably isn't the way to go.
Any input will be appreciated!
The best way to get a bitmap from an OpenGL window is to draw the content to a bitmap 'window'. See PFD_DRAW_TO_BITMAP for more information on how to do this.
If you want to go with the Alt+PrtScr way, you have to consider that many users have their own print screen tool installed which reacts on that very same hotkey. So you can't be sure that this hotkey will copy the content to the clipboard. It may just open the window of the installed print screen tool/utility.
Use the glReadPixels() approach. This question is asked quite often, here, on the gamedev.net forums and on other places, so google should show you code samples easily, but the glReadPixels() approach is the generally recommended approach.
Simulating keypresses is a recipe for disaster, I would stay away from that.