| View previous topic :: View next topic |
| Author |
Message |
X-Tools Valued Contributor

Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Thu Jul 22, 2004 8:31 am Post subject: Bitmap as taskicon / converting bmp to ico |
|
|
Hi,
I am looking for a way to view a bitmap as taskicon or to convert bmp to ico.
I am generating icons with vdsimage dll but I can save them as bmp, gif or jpg only.
How could I use them as taskicon. I tried the vds taskicon and vds vdsgui taskicon.
Bye, Fabian |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Thu Jul 22, 2004 8:47 am Post subject: |
|
|
It has to be an icon. Convert the bitmap to 16 or 256 colours, then copy it to the clipboard and paste it into an icon editor. Change the background pixels to transparent and then save it as an icon. For taskicons it's usually a good idea to convert the image to 16x16 size as well. IrfanView is good for this, but I seem to recall that VDS doesn't like the icon files it creates, hence why I use the copy/paste to an icon editor method. _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
X-Tools Valued Contributor

Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Thu Jul 22, 2004 8:53 am Post subject: |
|
|
Hi Jules,
thanks for your answer.
I already use irfanview and other tools for my icons, but on this app I want to change the taskicon on the fly (every 2 seconds). I know Irfan View has command line switches, but I cannot bundle irfanview with this app.
Bye, Fabian |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Thu Jul 22, 2004 9:19 am Post subject: |
|
|
In my Tech-Pro Menu I change the task icon whenever the CPU usage changes between certain thresholds, every second. The thing is, I have stored in the EXE as resources all the icons I need. Do you actually need to be able to convert the bitmaps to icons in real time? Is it not possible to include all the images you need, as icons, with your EXE? _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
X-Tools Valued Contributor

Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Thu Jul 22, 2004 10:12 am Post subject: |
|
|
| this is nearly the same that I want to do. I made 2 Taskicons for displaying the memory and cpu load. But I want to allow the user to define the colors and to display the percentage number on the graphical bar. |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Thu Jul 22, 2004 10:19 am Post subject: |
|
|
Ah. That would be pretty hard to do in VDS. It would be pretty hard to do in any language. I remmeber seeing some Delphi code to do something like this a long time ago. I seem to recall that after creating a bitmap image in memory, it then created the icon structure from this, also directly in memory. I don't think this is something you could easily do, even using the @lib() function to make API calls. _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Thu Jul 22, 2004 1:17 pm Post subject: |
|
|
Personally I think I would include many different colors, etc. and allow
the end-user to choose from these.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Thu Jul 22, 2004 4:06 pm Post subject: |
|
|
I thought that too, but to do what he wants, you'd also need versions of these icons with all the numbers from 0 to 100. Personally I don't think the user would care a hoot what the exact percentage is, in which case you could just go for 10 icons from 0 to 10 x 10%, in each colour. That's still a lot of icons to include, but it's probably the only way to do it. _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Fri Jul 23, 2004 5:35 am Post subject: |
|
|
My SuperRam application does this. It displays a grid in the taskicon which animates itself. The graph shows the level of ram currently available and the real time values of the amount of ram avilable. It looks very similar to the graph/scope object in VDS 4/5 but much smaller to fit in as a taskicon - 16x16.
It took alot of coding to do that, as the icon/image canvas is scrolled to the left by one pixel on each frame so it looks like the grid is moving, then you have to adjust each value on the grid so it corresponds to the previous value. Then to top it off the user can choose any color they want for the grid's colors.
How to do it>
In Delphi you can paint directly to the canvas which is what I used, unfortunately there is nothing directly in vds similar to this. But I'm certain there is an api which allows you to assign colors to certain pixels in a bitmap. You would then need to save the bitmap to an icon type.
IMHO you would be better off using a custom dll built for you as it would be much more reliable and work as you need it to. You can ask around here from dll developers if they would be willing to make a dll like that for you. Also you might want to ask Mindpower as his gadget dll more than likely can do something like this already. |
|
| Back to top |
|
 |
X-Tools Valued Contributor

Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Fri Jul 23, 2004 7:33 am Post subject: |
|
|
thanks for your help  |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Fri Jul 23, 2004 3:52 pm Post subject: |
|
|
XTools,
I have not added the ability to save icons to Gadget yet. I have been looking for a better way to handle basic graphics. It seems that using the Win32 way is too tedious for the common VDS user. But it is my intention to make it possible to save Icons and other graphic file types. As for doing what you want to do with the Win32 API this would require a very good knowledge of GDI. There are several ways that you could do what you want to do. I would be happy to discuss these with you offline. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
|