Can anyone HELP?

If your a member of codenstuff then this is the main place to be. Get together..talk..chat and ponder. Have fun. Chill out. Play games.
10 posts Page 1 of 1
Contributors
User avatar
hungryhounduk
VIP - Site Partner
VIP - Site Partner
Posts: 2870
Joined: Mon Jul 27, 2009 11:58 am

Can anyone HELP?
hungryhounduk
Image

Hey

If you look at the picture above you will see a really nice Drop Shadow with NO PIXELLATION wahooo;
This was done by vikhedgehog ( really nice work cooll; ) But when i asked him "How did you do that, He didn't know how he did it :? ...

So my Question is + Does anyone know how to get an Image with a DropShadow into VB and make it look 100% with no Pixelation, like the Image above..

20 Credits for the Person who helps me out :)

Cheers in Advance

Chris
Image
User avatar
MrAksel
C# Coder
C# Coder
Posts: 1758
Joined: Fri Mar 26, 2010 12:27 pm

Re: Can anyone HELP?
MrAksel
That happens on all Win7 forms. I don't know how else it's possible
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;


Over 30 projects with source code!
Please give reputation to helpful members!

Image
Image
User avatar
Codex
Coding God
Coding God
Posts: 2028
Joined: Wed Mar 31, 2010 5:50 pm

Re: Can anyone HELP?
Codex
Just make the image with dropdown shadow with photoshop (or something else like gimp) and then save it as .png .
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

Re: Can anyone HELP?
Axel
It's drawed
http://vagex.com/?ref=25000
Vikhedgehog
VIP - Donator
VIP - Donator
Posts: 812
Joined: Fri Nov 05, 2010 6:24 pm

Re: Can anyone HELP?
Vikhedgehog
I just put the clock into the form and added dwmapi.dll aero code. Thats all. I will release the source, ok? Give me some time to put the download link :)
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

Re: Can anyone HELP?
Axel
The clock is from....
http://vagex.com/?ref=25000
Vikhedgehog
VIP - Donator
VIP - Donator
Posts: 812
Joined: Fri Nov 05, 2010 6:24 pm

Re: Can anyone HELP?
Vikhedgehog
Axel wrote:
The clock is from....
idk, just found the dll somewhere. Btw the download is failing, check back in 1 hour lol. Nvm i upload to megaupload...

Here it is: http://vbnstuff.zxq.net/forum/viewtopic ... p=110#p110
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

Re: Can anyone HELP?
Axel
Btw , if you're having trouble with pixelation , you can use these things
That won't solve it completely though :/
Code: Select all
e.Graphics.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
e.Graphics.PixelOffsetMode = Drawing2D.PixelOffsetMode.HighQuality
e.Graphics.InterpolationMode = Drawing2D.InterpolationMode.High
Image

I made this(All credits go to me :D)
Add this somewhere
Code: Select all
    Private Sub DrawCircleDropShadow(ByVal e As Graphics, ByVal Opacity As Byte, ByVal DropShadowColor As Color, ByVal Circle As Rectangle, ByVal CircleColor As Color, ByVal Offset As Double, Optional ByVal Corner As Corners = Corners.BottomRight)

        e.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
        e.PixelOffsetMode = Drawing2D.PixelOffsetMode.HighQuality
        e.InterpolationMode = Drawing2D.InterpolationMode.High
        Dim CorrectedCircle As Rectangle
        Select Case Corner
            Case Corners.TopLeft
                CorrectedCircle = New Rectangle(Circle.X - Offset, Circle.Y - Offset, Circle.Width + Offset, Circle.Height + Offset)
            Case Corners.TopRight
                CorrectedCircle = New Rectangle(Circle.X + Offset, Circle.Y - Offset, Circle.Width + Offset, Circle.Height + Offset)
            Case Corners.BottomLeft
                CorrectedCircle = New Rectangle(Circle.X - Offset, Circle.Y + Offset, Circle.Width + Offset, Circle.Height + Offset)
            Case Corners.BottomRight
                CorrectedCircle = New Rectangle(Circle.X + Offset, Circle.Y + Offset, Circle.Width + Offset, Circle.Height + Offset)
        End Select
        e.FillEllipse(New SolidBrush(Color.FromArgb(Opacity, DropShadowColor)), CorrectedCircle)
        e.FillEllipse(New SolidBrush(CircleColor), Circle)
    End Sub
    Private Enum Corners
        TopLeft
        TopRight
        BottomLeft
        BottomRight
    End Enum
To use it , heres an example :
Code: Select all
    
Private Sub Panel1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint
        DrawCircleDropShadow(e.Graphics, 100, Color.Black, New Rectangle(50, 50, 100, 100), Color.LightBlue, 1.5, Corners.BottomRight)
    End Sub
  • e.Graphics = the graphics needed
    100 = the opacity , it may not be more than 255 or lower than 0
    Color.Black = The color of the dropshadow
    New Rectangle(50, 50, 100, 100) = the rectangle where the circle should be
    Color.Lightblue = the original circle
    1.5 = the offset (Look at the image below)
    Corners.Bottomright = This is optional
This is what the offset is
Image

*The offset is actually the spacing between the sides

And it works fine :D
Image

Resources : http://msdn.microsoft.com/en-us/library ... brush.aspx
http://vagex.com/?ref=25000
User avatar
code it
VIP - Site Partner
VIP - Site Partner
Posts: 821
Joined: Sun Oct 10, 2010 3:02 pm

Re: Can anyone HELP?
code it
As MrAksel said it does it for all windows 7 windows. Well, for me it does ! Also I tried other windows and it has a drop shadow just that smooth
User avatar
hungryhounduk
VIP - Site Partner
VIP - Site Partner
Posts: 2870
Joined: Mon Jul 27, 2009 11:58 am

Re: Can anyone HELP?
hungryhounduk
Just make the image with dropdown shadow with photoshop (or something else like gimp) and then save it as .png .
Hey

I have tried that so many times with .Png/.Gif/.Tif etc and it just does not work, Thats why i asked for some Help in this Thread...

Thanks Vikhedgehog for the Source, as it was the Reference to the "dwmapi.dll" that makes the DropShadow, I think, I replicated a form using some of the Source and the form now looks Just how i wanted it cooll;

So Vikhedgehog i wll pm you about your 20 Credits 8-)

Thanks all for your Answers

respect

Chris
Image
10 posts Page 1 of 1
Return to “Codenstuff boardroom”