Home All Groups Group Topic Archive Search About

Drop shadow under image

Author
7 Dec 2006 4:47 PM
Andrew
I want to drop a shadow under an image that I have showing in a control that
I made in vb.net 2005.

would I redraw the image as a solid color and put it under the image i am
trying to shadow.

How would I redraw the image as a solid color?

Author
12 Dec 2006 4:00 AM
Shane Story
The short answer, I think is to convert it to a bitmap having 1bpp I think.
For more info on this search google for "Bob Powell" "GDI+"
I think his graphics FAQs will tell you how.

Show quoteHide quote
"Andrew" <And***@discussions.microsoft.com> wrote in message
news:EEDFBE7B-A71F-481B-9D02-99B605C20D4C@microsoft.com...
>I want to drop a shadow under an image that I have showing in a control
>that
> I made in vb.net 2005.
>
> would I redraw the image as a solid color and put it under the image i am
> trying to shadow.
>
> How would I redraw the image as a solid color?
Author
12 Dec 2006 4:06 AM
Lucian Wischik
"Shane Story" <nospam@nothanks.com> wrote:
>The short answer, I think is to convert it to a bitmap having 1bpp I think.
>For more info on this search google for "Bob Powell" "GDI+"
>I think his graphics FAQs will tell you how.

Also I wrote a 1bpp conversion routine that's faster than the faq:
  http://www.wischik.com/lu/Programmer/1bpp

--
Lucian
Author
12 Dec 2006 6:14 PM
sstory
Lucian,

Of course we all know that straight unmanaged GDI is faster that GDI+, they
say because it hasn't been optimized for the latest hardware.

I guess the point is, if you stay within the managed code and don't do this,
you could theoretically easily port the code to another OS, maybe like on
Mono or something and it still work and you wouldn't be in "unmanaged code".

If all you care about is Windows then you can do as you have done.  Of
course you leave the saftey net of managed memory, etc. So you may cause
memory leaks etc.

It's always a tradeoff.

Show quoteHide quote
"Lucian Wischik" <lu***@wischik.com> wrote in message
news:dkasn2t7rsjp9fnnh8csp8lm5on6jlkkm0@4ax.com...
> "Shane Story" <nospam@nothanks.com> wrote:
>>The short answer, I think is to convert it to a bitmap having 1bpp I
>>think.
>>For more info on this search google for "Bob Powell" "GDI+"
>>I think his graphics FAQs will tell you how.
>
> Also I wrote a 1bpp conversion routine that's faster than the faq:
http://www.wischik.com/lu/Programmer/1bpp
>
> --
> Lucian
Author
12 Dec 2006 6:32 PM
Lucian Wischik
"sstory" <noth***@no.com> wrote:
>If all you care about is Windows then you can do as you have done.  Of
>course you leave the saftey net of managed memory, etc. So you may cause
>memory leaks etc.

Just to be clear, if you use the code I posted then your code will
*not* leave the safety net of managed memory.

I see this as a case of just filling in gaps, places where the .net
framework hasn't yet got complete coverage of the unmanaged
functionality that it wraps.

--
Lucian
Author
12 Dec 2006 10:32 PM
sstory
Yes, it definitely has gaps.

Show quoteHide quote
"Lucian Wischik" <lu***@wischik.com> wrote in message
news:i8ttn29qtrep4nqd6r4hctkvaegi368us9@4ax.com...
> "sstory" <noth***@no.com> wrote:
>>If all you care about is Windows then you can do as you have done.  Of
>>course you leave the saftey net of managed memory, etc. So you may cause
>>memory leaks etc.
>
> Just to be clear, if you use the code I posted then your code will
> *not* leave the safety net of managed memory.
>
> I see this as a case of just filling in gaps, places where the .net
> framework hasn't yet got complete coverage of the unmanaged
> functionality that it wraps.
>
> --
> Lucian