IShellItemImageFactory Icon\Thumbnails different from Windows 7 Desktop - c#

I am using IShellItemImageFactory to get icons and thumbnails for files and directories. In most cases this works great, but in some cases I get an image that is quite different from the one in explorer.exe.
Folders in explorer.exe show some of their contents represented as pieces of paper. Whenever I request an image for a directory, I get an empty folder in my program.
Videos playable by Windows Media Player in explorer.exe show as a piece of filmstrip with a thumbnail as the cell. When I request an image for such a video file I get just a thumbnail with no movie strip border.
I am sure there are other examples, but in general I just want to know if there is a way to request an image from the system that looks exactly like whatever is displayed on the desktop or in a folder in explorer.exe. I want everything to look the same so my program isn't "sloppy."

The answer is here:
http://msdn.microsoft.com/en-us/library/cc144118(v=VS.85).aspx#adornments
The adornments are the effects I am missing and it seems I would have to render them manually.
TiKu on MSDN explained this to me and deserves the credit.

Related

Quickly loading, resizing, and displaying images from disk

I'm learning my way around windows forms by making a little app to help clean up a folder on my PC with thousands of images. I'm currently storing the images as a List<FileInfo>. It works fine using
PicBox.Load(ImageFileList[count++].imgFile.FullName);
but that's a bit slow when I only need a second to look at each image.
So the problems are:
How to load the images quickly
How to do so in a folder where one image might be a 25kb png and the next might be a 1GB TIFF
If I open an image from the folder in Windows Photo Viewer and hold the right arrow key, it zips along with blurry images I assume are resized thumbnails and a loading message over them. In Win 10 Photos, it loads non-blurry images faster but hiccups when it hits larger files. Either of those behaviors would be fine for me.
Try to do your things using background tasks :
https://learn.microsoft.com/en-us/dotnet/desktop/winforms/controls/walkthrough-implementing-a-form-that-uses-a-background-operation?view=netframeworkdesktop-4.8
Maybe this can help too :
https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.application.doevents?view=windowsdesktop-6.0

how to display photos from a folder in C# (updated real-time)

I have a camera and I want to use C# to real-time display the object taken by the camera. In C# program I use a C-based .exe to retrieve images from the camera to one fixed folder in my computer, and then try to display and update the image (like a live video). My problem:
(1) how to update photo viewer smoothly in C# (I hate refreshing the interface) or shall I make those photos into a video first?
(2)as the pics in the folder are real-time updated, how could I make sure the sequence of playing, or avoid conflicting? I plan to keep only 10 images, and the 11th image retrieved will replace the 1st image..., I am not very clear about that...
Thanks for the reading, sorry I might have very silly questions above...

Xamarin launcher icons for Google Play

It's my first time trying to publish my app on Google Play. I am using Xamarin 4.2 and C#.
My questions:
Can I use Microsoft Paint to create launcher icons?
My plan is to create 36x36px (ldpi), 48x48 (mdpi), 72x72 (hdpi) and 96x96 (xhdpi) launcher icons: Is this Ok so far?
The documentation says .PNG; I guess ldpi and mdpi are just naming conventions?
However my search found different numbers of icons and different sizes.
My plan is to place each of these icons under a separate folder as follows:
Resources\drawable\drawable_ldpi\ic_launcher
Resources\drawable\drawable_mdpi\ic_launcher
etc. Is this arrangement correct?
What about the high resolution application icon: Is it placed in the resources folder? or uploaded separately into Google play console?
First take a look at googles iconography guide: http://developer.android.com/design/style/iconography.html
As you can see each density has a name, you should create a drawable_(density) folder inside the resources directory for each one you plan to support and use the correct icon size.
As an example you should have Resources/drawable_mdpi (density ñame is always in lower case)
And for the hi res icon i supose you refer to the image for google play, it is uploaded when you fill your apps description.
About using Paint to create those icons, well, using paint for anything more complex than drawing a line is a bad idea...
If you don't have any program like Photoshop you always can use Gimp, its free and very powerful:http://www.gimp.org

Capturing Images from Playing Video File

I am developing C# desktop application and referring this link to Play video file http://www.codeproject.com/Articles/2632/DirectShow-MediaPlayer-in-C , now from this playing video file ,when I click on this panel (shown in above link ) how to capture Images from playing video file,I searched but I found all examples showing capturing Images from some device(for eg.webcam,etc..) ,In my case Its not device it's file which I am browsing from Directory and Playing ,as I am new to this Video capturing Please direct me how I can do this
"Capture" normally refers to image acquisition when you obtain the image from external source. You want to take a copy of currently displayed video frame instead. There are several ways to do it and when it comes to playback when video is being visualized, the video renderers typically offer GetCurrentImage method which returns a copy of currently displayed video frame, possibly even converted to RGB.
Method syntax slightly differs between video renderer versions.
See previous topics on achieving this:
take picture from webcam c# (references sample application from DirectShow.NET)
IBasicVideo CetCurrentImage catastrophic failure(DirectShow.NET)
Also:
Best DirectShow way to capture image from web cam preview ? SampleGrabber is deprecated
Grabbing images from a DVD using direct show
You need a filter which captures screen and sends the video down the stream.
In the DirectShow Library there is a sample filter called PushSource and inside there is PushSourceDesktop.
At Codeplex there are Examples like this (Click me) or Information (Click me) about Filters.
You can also use a "SampleGrabber" DirectShow filter: just place it in the filter chain between your source filter and render filter.
More info about SampleGrabber:
see MSDN

Get Taskbar's Battery and PhoneSignal indicators icons and draw into a picturebox

Is there any way to get taskbar's battery and phonesignal indicators icons and then draw into a picturebox or something?
Why do I need this?
I need all screen space available, so all forms are maximized and they cover up the windowsmobile taskbar. But, I have to display information about battery e phone signal strength in just a couple of forms.
I know how to get their values (like systeminformation.phonesignalstrength), but what I want is the "current icon", so I don't need to worry about their values. It's just a visual information for the user.
In last case, if this is not possible, how to get those icons from windowsmobile shell, so I'll draw them by my self, treating each differente status/values that they assume. (This is what I don't want to do!)
Thanks in advance and sorry for my poor english.
There is already similar example available. Have a look.
I would have pasted the code for it, but it is in C++ and it would be huge to paste it all here :)
You would need to covert that C++ code to C#.
You will need to -
1. Find the handle of system tray.
2. Get number of buttons (that's right) in the tray.
3. For each button...
a) Read button data buffer.
b) Get TRAYDATA from that buffer.
c) Get Icon related to this TRAYDATA object instance.
ImageList Image16List = new ImageList();
...
ICONINFO iinfo;
if(GetIconInfo(tray.hIcon,&iinfo) != 0) {
int iconindex = Image16List.Add(tray.hIcon);
//do stuff
}
Another very good article link here.
Most of the taskbar images are stored as .BMP files in the \Windows directory. For example, in Windows Mobile 6, the battery image is located in \Windows\battery.bmp. You can use Windows Mobile Device Emulator and Remote File Viewer to copy the files to your PC. The images are sometimes different in different versions of Windows Mobile.

Categories