C++ ImGui - Display a Gif or Video? - c++

I am currently coding a winrate statistics menu for League of Legends (which got approved) using ImGui and I wonder if it is possible to display a GIF or MP4 on the Menu as a Preview or Usage Tutorial not from File/Memory but from an URL as I want to keep the File as small as possible for now.
You probably would have to use a filestream, downloading the file to tmp and then displaying it as a Texture?
I found a similar question, and I wonder if something since then has changed:
https://github.com/ocornut/imgui/issues/2680
Is it still required to use an additional GIF loader?
Are there any easy ways now to achieve that?
I am a bit (new) to ImGui and would be very happy about any reference source code (not to copy paste, just to learn it).
Thanks for any help :).

Related

Retrieve some data from a currently playing video file on windows?

I'd like to get the current time of a playing video and then read from a relevant subtitle file and stream the subtitles at the right time to a terminal-like window. Getting the subtitles directly from the video file would probably be more efficient, but I'd like to tackle one problem at a time.
What's the best way to do this?
I've looked at VLC's modules and such, but it seems I'd have to completely recompile it with my module for each targeted platform. Which I'd rather just have a standalone project in C++.
I've tried reversing through cheat engine so I could ReadProcessMemory(). but can't seem to find anything related to current time. Tried VLC and Windows Media Player.

Programatically resizing individual Groups of a PSD, then rendering them to PNG in C++

I want to know if it is possible to read PSD files from C++, resize 1 specific Group programmatically, then render the result to a PNG. So far I found some code that reads and renders PSD files "as is", here: http://www.codeproject.com/Articles/10398/Import-Adobe-Photoshop-psd-images
The problem I foresee is that just rendering a PSD as is is pretty easy, but resizing Groups programmatically would require much more effort.
The problem I see is that Photoshop PSD files are notoriously difficult to read... see this poor soul.
Also, the code you link to is from 2006 which pre-dates the current "Smart Objects" and real-time editing so I would doubt it will work for anything recent - though you may be fine if you only want to read some old files, or new uncomplicated ones of a specific project that doesn't use such features.
I would suggest you export the layers from Photoshop as PNGs and then work with that. My answer here might get you started.
So far, there seems to be no library to do what I want to do. Reading out the composite preview from PSD files is easy, as demonstrated in the codeproject link I posted in my question, but manipulating individual groups or layers, then rendering the composite preview again seems impossible for now.

NRRD volume offset in 2D renderer

I'm just looking into a project of making a scan viewer much like Slice:Drop from the Xtk examples. I'm very new to XTK and web programming in general.
I'm using an example file of a brain, but in Slice:Drop and my own implementation (mostly borrowed from "Lesson 13: I want 2D!"), the scan comes out offset, so the image is cut off. Does anyone now how I can fix this? I was looking for a translate method or similar in the volume class, but haven't found anything useful so far.
I've tried loading this file in a couple of desktop scan loading software packages, and it loads fine (meaning centered, not cut off) there, so wondering where the problem could be.
Does anyone have any idea what might be going on here?
Cheers
Edit: Just tried the same file in .nii format and that loaded fine, with the scans all centered. Maybe something strange going on with the NRRD file ...

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.

HTML renderer drop-in, C++ code

I want to drop in an HTML renderer that will basically be used for render-to-texture operations.
If I can render the HTML to an HDC, that would be perfect.
I found HTMLayout, which isn't bad. But it isn't open source. But I'm wondering if there's a way to somehow tap into IE or Mozilla/Gecko code, how realisitic/difficult this will be, and possibly some pointers on how to do it.
It will be for a regular straight C++ directx application
Edit
Wow! Mozilla has an embedding kit!
Take a look at WebKit.
Qt can do it, render to a QPainter. See for example http://doc.trolltech.com/4.6/qwebpage.html But not sure if it's easily used if you are not already using Qt.