Jump to content

Redraw of Icons


Recommended Posts

I've been working on a program where I've been redrawing icons and then posting them. The problem is on this specific machine I'm trying it on, is that it is not redrawing. This is real puzzling because the program works flawlessly on my test machine. But if I save the icon and then reload it, it only draws from the left up to the end of the content of the icon on the right, and then leaves the rest white. Any ideas on how to address this?

Or a good related question: How do you know what the size is of the icons like on the taskbar, notification area, or the form?

Edited by Glenn9999
Link to comment
Share on other sites


I've been working on a program where I've been redrawing icons and then posting them.

I'm still trying to figure this one out. Some screen shots.

It looks like garbage when I try to screen shot it and save it, but here's the good one, this works as it should.

And then there's the bad one. Not working, but only on a specific machine.

Could this be a driver issue of some kind?

Link to comment
Share on other sites

If a screen cap program on the machine is capturing it as well, that would indicate the data being displayed is corrupted. It very well could be a driver issue in that case - if it looked fine in a cap I'd say it was a video driver, but if it's corrupt in both it's less likely the video driver is at play (it still could be, of course, but it's less likely to be a root cause). Can you capture this installation to a VM and repro it in there?

Link to comment
Share on other sites

Can you capture this installation to a VM and repro it in there?

I tried XP Pro SP3 (vanilla) on a VM, and it worked. It works on my development machine, and on Windows ME (VM and real). So I'm thinking that the problem is something unique to the configuration of this machine.

I'll probably try patching the SP3 VM and see if anything changes. I don't know how GDI works with the drivers, so I can't say really what to try next if the patched SP3 VM works. Try contacting the video driver maker maybe.

Edit: Tried it on a fully patched XP Pro SP3 VM. Worked there too.

Edited by Glenn9999
Link to comment
Share on other sites

Okay, figured this out. It works in 16-bit graphic environments, but not 32-bit graphic environments.

Evidently it will take some research on how to fix. Thanks for reading.

Edit: And drawing 16-bit icons works in the 32-bit environment. It just doesn't handle 24-bit icons well for some reason.

Edited by Glenn9999
Link to comment
Share on other sites

Evidently it will take some research on how to fix. Thanks for reading.

I figured this out. Evidently, there's a bug in Delphi on handling bitmaps when there is no PixelFormat specified. It goes up to the highest graphic environment encountered (and on the problem machine 32-bits) and then drew the garbage. Explicitly stating it in each step of the process fixes it. Also, as implied, there's a problem in the draw setup for 32-bit bitmaps - I was able to fix that, but throttling it down to 24-bit fixed it as well.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...