Drawing an IplImage within an MFC Dialog Application - visual-studio-2010

I have an MFC dialog application that I am using as the front end for some image processing with OpenCV 2.1. I would like to move away from using the cvShowImage and place my image directly on the dialog box or a suitable container. I've found examples that with a technique using an MFC SDI application with a View/Doc model, but I can't figure out how to convert that.
I'm curious if anyone has done this and/or knows where an example may live that does this?
Also, this is my first MFC application.
Thanks all.

There is a CvvImage type in highgui with a drawtoHDC(or simialr) function that will draw into a bitmap

Related

How can I create a desktop GUI application similar to Blender or Maya?

I would like to create a customized Graphical User Interface Window similar to Blender or Maya GUI window. Please refer this below image:
How and where to begin with to design and create a customized GUI window similar to Maya / Blender UI window. Please refer the below image which has video / image preview option and floating buttons and menus:
Being a student, instead of using other desktop GUI applications for 3D purposes, can I able to create a Graphical User Interface window similar to Blender / Maya.
Is it possible to create a Desktop Graphical User Interface application? If it is possible then how to begin with to achieve this?
Blender has custom GUI tooling that uses OpenGL. You could try learning OpenGL (or Vulkan) and start rendering things, but you should know that creating a GUI library will be a huge challenge. You'll need to think about things like dealing with keyboard input, font rendering, text selection...
You'll likely save a lot of time by using an existing GUI library that has solved these problems already, like Qt, Flutter, GTK+. Or you could use the code in Blender, but I'm guessing that it will be harder to find good documentation and community support since it's an internal library.
Desktop applications are usually developed in languages like C# and C++, mostly in any software like Visual studio. Since you need a graphics software, you need a render engine somewhat similar to Blender. Try using OpenGL, or any other render engine of your choice, with these former methods, I mean to combine both the idea of "rendering" and "programming"....It's all about inspirations and ideas!
Imho, it won't be an easy task. If you are ready to take up the challenge.
Dear Imgui will be good starting point.

How to get all frames of an animated GIF using TWICImage?

I'm working with Embarcadero RAD Studio XE7. In this context, I'm interested to use the Windows Imaging Component (WIC) library to read and show the content of an animated GIF image.
I saw that the VCL provides a TWICImage component, which with I'm able to read easily the first frame of my animated GIF. Now I want to implement a timer to loop through all my frames and show them one by one, in order to show the complete GIF animation on my form.
Which properties the TWICImage provides to do that?
So, as the VCL TWICImage component seems strongly limited, and as I cannot reach my goals using it, I decided to write my own wrapper around the WIC library.
For those who would encounter the same difficulty, I also advise you to implement your own wrapper, it is not such a difficult task.
It's a shame for the TWICImage component, but unfortunately it seems to have been sloppy.
Thanks for all the above replies.

Opening an image in TImage from a server

I am working on a huge project using Delphi XE5, the core of the program is to open an image using the TImage component on the application but the image is on a server that is accessed trough the internet. The image that displays depends on the criteria set trough other events or actions from the user. I already have the criteria's code etc in place, I only neet die Image display part..
What other components do I need to use other than TImage component to make this happen and how does one do this? I have been searching for answers for more than a week and couldn't find something that works.
This is also a multi platform application.
Found what I was looking for at FireMonkey iOS RAD Studio XE2 - Display Image on form loaded from URL although its a bit slow, but for now it can do the job just fine.
Well you can load a TBitmapImage or TJPEGImage from a stream and then stick it into your TImage. However, you will need to know the image type before you do this. Here is an example using TJPEGImage: JPEG data-stream to TImage

Using CxImage in VC++ 2008 MDI application

Im new to cximage so i need help. Im building as MDI project in which i need cximage functionalities.
Please help me by specifying how to load and display an image in the child window.
How to get active windows hwnd and hdc.
this is the requirement:
Drawing App(Image Viewer and editing) using cximage and Mdi
First of all, there should be a provision to open an image (any format i.e. tif, jpg, bmp…..).
The user should be able to do operations like rotate, zoom negate etc. The changes should be saved after prompting.
The user should be able to draw standard shapes like rectangle, square etc on top of the image.
Should be able to fill color in the shapes drawn. Save that as well.
Also user should be given a provision to change an image format(i.e. may be from jpg to tif and so on) and save.
http://www.codeproject.com/Articles/1300/CxImage itself is a good tutorial and it has sample project as well.
see the tutorial below to which explains how to get active windows handle in MDI app:
http://www.winprog.org/tutorial/app_four.html

Can I place a window inside a window? Like a videoplayer

I'm using C++(Visual Studio 10) on Windows XP.
I want to make an application similar to a video player where there is a window inside an outer window where the actual video is displayed. On the outer window I will have the GUI, buttons, etc...
Basically I'm composing two windows together. And the frames in the inner window are updated by another thread that does image processing(I will use OpenCV for this).
Any pointers? I just need to know the basic structure for this.
Build the entire GUI using win32 and then convert the IplImage to BITMAP to be able to display it. It seems someone posted a quick and dirty solution to do that, but I haven't tried it.

Resources