Assuming that you know about drop box(no problem if you don't know).
In my desktop application there is an upload functionality. I want to mark correct sign on file icon at bottom left after upload.(same as Dropbox does).
How can I do that? What's that trick?
Asked
Active
Viewed 387 times
2

Priyank
- 1,219
- 11
- 30
-
possible duplicate of [Shell Icon Overlay (C#)](http://stackoverflow.com/questions/843506/shell-icon-overlay-c) – James Hill Oct 19 '11 at 12:33
1 Answers
1
DropBox is a shell extension, so it uses the OS icons and overlay them.
In your case, if it's a desktop application you can overlay your icons using something similar to this:
private static object mOverlayLock = new object();
public static Image GetOverlayedImage(Image baseImage, Image overlay)
{
Image im = null;
lock (mOverlayLock)
{
try
{
im = baseImage.Clone() as Image;
Graphics g = Graphics.FromImage(im);
g.DrawImage(overlay, 0, 0, im.Width, im.Height);
g.Dispose();
}
catch
{
// LOG EXCEPTION!!
}
}
return im;
}
This is a basic example. You can also play with the overlay position, (topleft, middleleft ...), that requires a little bit more programming.
Then, from your application you can call this method to get the result image. For example
...
Image folderIcon = GetFolderIcon();
Image upToDateOverlay = GetUpToDateOverlay();
Image folderUptoDate = GetOlverlayedImage(folderIcon, upToDateOverlay);
// Then assign this image to your control item (treelistnode, listViewnode, whatever)

Daniel Peñalba
- 30,507
- 32
- 137
- 219
-
Thanks Daniel... I got it.. but Can you little more explain that How can I implement this function?(I need seriously this functionality in app.) – Priyank Oct 28 '11 at 03:43
-
-
So could your mark the question as answered if it's answered? Thanks! – Daniel Peñalba Nov 02 '11 at 09:12