![]()
|
|
Visual Basic Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
Public Class GraphX Public Function GrayScale(ByVal img As Image) As Image Public Function SetImageAlpha(ByVal img As Image, ByVal Alpha As Integer) Public Function Invert(ByVal img As Image) As Image Public Function RotateImage(ByVal img As Image, ByVal angle As Single) As Image Public Function ChangePixelFormat(ByVal img As Image, ByVal pixel_format As PixelFormat) As Image End Class Public Class BackBuffer 'Properties Public ReadOnly Property Graphics() As Graphics Public ReadOnly Property Width() As Integer Public ReadOnly Property Height() As Integer 'Subs Public Sub ChangePixelFormat(ByVal pixel_format As PixelFormat) Public Sub ExportImage(ByVal Path As String, ByVal Format As ImageFormat) Public Sub SetTexture(ByVal img As Image) 'Functions Public Shared Function FromImage(ByVal img As Image) As BackBuffer Public Function GetTexture() As Image Sub New(ByVal Width As Integer, ByVal Height As Integer, Optional ByVal PixelFormat As PixelFormat) End Class Public Class Blurer 'Events Public Event BlurProgressStarted(ByVal maximum_value As Integer) Public Event BlurProgressChanged(ByVal value As Integer) Public Event BlurProgressPreview(ByVal bmp As Bitmap) Public Event BlurProgressEnded(ByVal result_bmp As Bitmap) 'Properties Public Property Image() As Bitmap Public Property BlurIntensity() As Integer Public Property BlurerMode() As BlurMode 'Functions Public Function Blur() As Bitmap Sub New(ByVal Image As Bitmap, ByVal BlurIntensity As Integer, ByVal BMode As BlurMode) Public Enum BlurMode Vertical Horizontal Diagonal BackwardDiagonal Gaussian DoubleDiagonal End Enum End Class Public Class MandelBrotFractal 'Properties Public Property Bounds() As Size Public Property Alpha() As Integer Public Property AntiAliasing() As Integer 'Subs Public Sub EnableAntiAliasing() Public Sub DisableAntiAliasing() Public Sub SetColor(ByVal VectorType As VectorType, ByVal c As Color) Public Enum VectorType Outline Outline2 Outline3 Outline4 Outline5 Outline6 Outline7 Outline8 MandelBrotOutline5 MandelBrotOutline4 MandelBrotOutline3 MandelBrotOutline2 MandelBrotOutline1 ShadowInline ShadowOutline MandelBrot End Enum 'Functions Public Function Render() As Image End Class |








Dieser Beitrag wurde bereits 5 mal editiert, zuletzt von »Krissel095« (9. Mai 2010, 21:25)

Ich werde heute noch eine Property einbauen, mit der man die Farben festlegen kann, da diese momentan zufallsgeneriert sind.


|
|
Visual Basic Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
Dim mb As New GraphX.Drawing.MandelBrotFractal(New Size(PictureBox1.Width, PictureBox1.Height)) mb.SetColor(GraphX.Drawing.MandelBrotFractal.VectorType.MandelBrot, Color.Black) mb.SetColor(GraphX.Drawing.MandelBrotFractal.VectorType.ShadowInline, Color.Lime) mb.SetColor(GraphX.Drawing.MandelBrotFractal.VectorType.ShadowOutline, Color.FromArgb(255, 90, 90, 90)) mb.SetColor(GraphX.Drawing.MandelBrotFractal.VectorType.MandelBrotOutline1, Color.FromArgb(255, 90, 90, 90)) mb.SetColor(GraphX.Drawing.MandelBrotFractal.VectorType.MandelBrotOutline2, Color.FromArgb(255, 90, 90, 90)) mb.SetColor(GraphX.Drawing.MandelBrotFractal.VectorType.MandelBrotOutline3, Color.FromArgb(255, 90, 90, 90)) mb.SetColor(GraphX.Drawing.MandelBrotFractal.VectorType.MandelBrotOutline4, Color.FromArgb(255, 90, 90, 90)) mb.SetColor(GraphX.Drawing.MandelBrotFractal.VectorType.MandelBrotOutline5, Color.FromArgb(255, 90, 90, 90)) mb.SetColor(GraphX.Drawing.MandelBrotFractal.VectorType.Outline, Color.FromArgb(255, 90, 90, 90)) mb.SetColor(GraphX.Drawing.MandelBrotFractal.VectorType.Outline2, Color.FromArgb(255, 80, 80, 80)) mb.SetColor(GraphX.Drawing.MandelBrotFractal.VectorType.Outline3, Color.FromArgb(255, 70, 70, 90)) mb.SetColor(GraphX.Drawing.MandelBrotFractal.VectorType.Outline4, Color.FromArgb(255, 60, 60, 90)) mb.SetColor(GraphX.Drawing.MandelBrotFractal.VectorType.Outline5, Color.FromArgb(255, 50, 50, 90)) mb.SetColor(GraphX.Drawing.MandelBrotFractal.VectorType.Outline6, Color.FromArgb(255, 40, 40, 90)) mb.SetColor(GraphX.Drawing.MandelBrotFractal.VectorType.Outline7, Color.FromArgb(255, 30, 30, 90)) mb.SetColor(GraphX.Drawing.MandelBrotFractal.VectorType.Outline8, Color.FromArgb(255, 20, 20, 90)) mb.AntiAliasing = 2 PictureBox1.Image = mb.Render() |

Benutzerinformationen überspringen
Dabei seit: 14. Januar 2010
Wohnort: Lübeck
Frühere Benutzernamen: r3mote
|
|
Visual Basic Quellcode |
1 2 |
Dim blurer As New GraphX.Drawing.Blurer(PictureBox1.Image, 15, GraphX.Drawing.Blurer.BlurMode.Gaussian) PictureBox1.Image = blurer.Blur() |
Das erste Attribut ist das Bild, das zweite die Intensität und das dritte die Methode, in dem Fall Gaußscher Weichzeichner.|
|
Visual Basic Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
Public Function Blue(ByVal Pica As Image) As Image Using Bmp As Bitmap = Pica.Clone() Using IAttributes As New ImageAttributes Using G As Graphics = Graphics.FromImage(Bmp) IAttributes.SetColorMatrix(New ColorMatrix(New Single()() _ {New Single() {-0, 5.0F, 2, 0.0F, 2, 0.0F, 0.0F, 0.0F}, _ New Single() {-0, 5.0F, -1.0F, 0, 0.0F, 0, 0.0F}, _ New Single() {-0, 5.0F, 0.0F, -1.0F, 0.0F, 0.0F}, _ New Single() {-0, 5.0F, 0.0F, 0.0F, 1.0F, 0.0F}, _ New Single() {0, 5.0F, 1.0F, 1.0F, 0.0F, 0.0F}})) G.DrawImage(Bmp, New Rectangle(0, 0, Bmp.Width, Bmp.Height), _ 0, 0, Bmp.Width, Bmp.Height, GraphicsUnit.Pixel, IAttributes) Return Bmp.Clone() End Using End Using End Using End Function |
|
|
Visual Basic Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
Public Function Negative(Byval Pica As Image ) As Image Using Bmp As Bitmap = Pica.Clone() Using IAttributes As New ImageAttributes Using G As Graphics = Graphics.FromImage( Bmp ) IAttributes.SetColorMatrix( New ColorMatrix( New Single()() _ {New Single() {-2,5F, 0F, 0F, 0F, 0F}, _ New Single() {0F, -1F, 0F, 0, 0F}, _ New Single() {0F, 0F, -1F, 0F, 0F}, _ New Single() {0F, 0F, 0F, 1F, 0F}, _ New Single() {1F, 1F, 1F, 0F, 0F}})) G.DrawImage( Bmp, New Rectangle( 0, 0, Bmp.Width, Bmp.Height ), _ 0, 0, Bmp.Width, Bmp.Height, GraphicsUnit.Pixel, IAttributes ) Return Bmp.Clone() End Using End Using End Using End Function |
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Drewstar« (24. Juni 2010, 19:59)
Einfach in den Eigenschaften gucken..
Zitat
Dim blurer As New GraphX.Drawing.xxx