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

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
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]()
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!

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
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 

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
Btw , if you're having trouble with pixelation , you can use these things
That won't solve it completely though :/

I made this(All credits go to me
)
Add this somewhere

*The offset is actually the spacing between the sides
And it works fine

Resources : http://msdn.microsoft.com/en-us/library ... brush.aspx
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

I made this(All credits go to me

Add this somewhere
Code: Select all
To use it , heres an example :
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
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

*The offset is actually the spacing between the sides
And it works fine


Resources : http://msdn.microsoft.com/en-us/library ... brush.aspx
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
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
10 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023