Re: Icon transparency after Serialization
- From: "Mike_IntermediateVB" <MikeIntermediateVB@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 16 Oct 2005 14:12:02 -0700
Thats an interesting article, (written in 1995) and I see the reference about
the Icons Masks. I do need to learn a bit about accessing windows API's. I
have used lots of examples (and use one that gets the Icons for me ) perhaps
you know of some reference webpages that might help me understand how to
access these API's form .net (or VB6), then I can have a play around.
I am currently using a 'File Icon Class' from VbAccelerator to get the icons
LINK->
http://www.vbaccelerator.com/home/NET/Code/Libraries/Shell_Projects/Getting_File_Icons_Using_The_Shell/article.asp
This article also shows the issue with the shadows. When I retrieve the
Icon using this class, it displays fine. When I save it the db (serialize and
save as blob) and then redisplay (using same code) it has lost the alpha
channel (as seen in article), All I can think of is that it's the
serialization causing the problem.
Thanks anyhow for your reply.
"Michael Phillips, Jr." wrote:
> Icons have there own image format.
> They have a header, a directory and the image with
> the masks.
>
> If you write the image to the blob in the proper format,
> then you should not have any problems deserializing the
> image when reading from the blob.
>
> The following article should help you out:
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/msdn_icons.asp
>
>
> "Mike_IntermediateVB" <Mike_IntermediateVB@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote
> in message news:EE5B38BC-EEC8-43CA-9D91-83A359438AEB@xxxxxxxxxxxxxxxx
> >I am developing an application that stores files in a database, Along with
> > the file I'd like to store the files Icon. I have created a File object
> > that
> > I can serialize, compress and write to the blob field of a database. This
> > is
> > working quite well, however for the last week I have been trying to figure
> > out how I can preserve an Icons transparency though out this process. I
> > would
> > not mind converting the icon to a bitmap, so long as the resulting image
> > look
> > correct.
> >
> > I have tried various methods of loading the Icons in the first instance,
> > but
> > it seams to be the serialisation process upsets the image.
> >
> > My latest attempt was to try and create a mask from the (alpha channel)
> > transparent colour of the Icon by creating an off screen bitmap with a
> > background color that is not likely to be in the Icon. Then paste the icon
> > over this background.
> > Which I had hoped I could then save to the Db and when I redisplay it
> > simply
> > make the defined color transparent. However, after the paste I still get
> > an
> > odd black blob where the Icon has a shadow effect.
> >
>
>
>
.
- Follow-Ups:
- Re: Icon transparency after Serialization
- From: Michael Phillips, Jr.
- Re: Icon transparency after Serialization
- References:
- Re: Icon transparency after Serialization
- From: Michael Phillips, Jr.
- Re: Icon transparency after Serialization
- Prev by Date: Re: What is the ImageFormat of an existing Image
- Next by Date: Re: Icon transparency after Serialization
- Previous by thread: Re: Icon transparency after Serialization
- Next by thread: Re: Icon transparency after Serialization
- Index(es):
Relevant Pages
|