Owner drawn taskbar thumbnail preview - c++

Is there a way to draw the taskbar thumbnail preview on my own, instead of letting Windows draw it for me?
What I need is a dynamic thumbnail; for example, let's say I want the thumbnail to be a reverse of the "real" thumbnail. Any way to do that?

Yeah you can do with this method: DwmSetIconicLivePreviewBitmap.
Complete example: http://msdn.microsoft.com/en-us/library/ff819048(v=vs.85).aspx

Related

There's any way to overlay an Image over autocad by holding some key?

I'm Having classes on computational design at university through AutoCad and we are asked to model some drawings. I'd like to know if there's any way to make the image I'm modelling appear on top of the screen while I hold some key, and go back to the model as soon as I release it.
There is no such built-in feature in AutoCAD. You can however insert the image in the background. Or you can write your own plugin to do that.
1) You can use the Attach command to attach your image in AutoCAD
2) Once the image is attached, then you can create your model on top of the image by using the "DR" alias for Draworder and select the image to place on top or behind your model.
3) Select the middle mouse button to Pan around and when you do this, your image file will disappear temporarily until you release your mouse button.
Hope that helps!

Need a way to display image and draw on the image in Visual C++

The current way that I found was to make a bitmap and paint it into a picturebox,
but there it is very slow when trying to scroll the panel (the picturebox is inside a scrollable panel).
Is there a better way to achieve this functionality?
Load the bitmap only when your picture box is created, then leave it in memory until the picture box is destroyed. Loading the bitmap every time OnPaint is called will destroy performance.
Also make sure you aren't re-painting your bitmap if you receive a WM_PAINT message and nothing has changed.
That image size, 1500x2000 will be slow. How about resizing it to 25% to show a preview and if a user wishes to see the whole image give them an alert it may take some time.

what's the best way to display images in qt? also I would like to zoom in to particular areas as well

I've been using label to display images. I'd like to be able to click and create a bounding box then be able to drag the cursor to move around in the image. What would I need to do this? Thanks.
I'm not 100% sure I understand what you are trying to do, but I think the QGraphicsScene is what you are looking for. You can (among many other things):
Render images (QGraphicsPixmapItem, for example)
Change the zoom level when rendering the scene on a QGraphicsView.
Select things using a "rubber band"
Move items around with the mouse (see QGraphicsItem::ItemIsMovable)
etc.
You may need to get familiar with Qt's graphics view framework.

how to add an image along with text in a button in MFC?

Am having a hard time in adding image along with a text in a Button..I know that it can be done by enabling the owner draw function with bitmapbutton class..But I dont want to that..so is ther anyother way that i can add an image along with text without drawing the text?
Since you are using MFC Feature Pack, just cast your button into a CMFCButton class. Then you can call CMFCButton::SetImage to add the image.

How could I insert a bitmap or other image objects in a CListCtrl in MFC?

I want to list the thumbnails of a set of photos in a listctrl. But the only way to achieve this is to use the setImageList method to bind a image list to the CListCtrl object and insert items like this: InsertItem (int nItem, LPCTSTR lpszitem, int nImage). I also must modify the listctrl's style by ModifyStyle(LVS_TYPEMASK, LVS_ICON) to force it to display the icon of each item.
I don't think this approach a good way to achieve my goal. Can I add items of bitmap or other image objects directly in a CListCtrl?
Thank you very much!
Why do you think it's not a good approach? Your other options are to make it an owner-drawn control and render the images yourself, or use a callback for the images via CListCtrl::SetCallbackMask.
List controls use image lists for a reason; the bitmaps are stored in a way that is most efficient for rendering the list control. You would be pretty hard pressed to do it any better.
Given that you need these sorts of extended features, sounds like you must use owner-draw. A good example is here. It doesn't show how to draw the image, but once you've got the owner-draw procedure set up you should be able to use typical BitBlts to paint the images.