vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
sevAniGif - als kostenlose Vollversion auf unserer vb@rchiv CD Vol.5  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2025
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

VB.NET - Fortgeschrittene
Re: Spiegel Bild einer PictureBox von C# ins VB 
Autor: henrikl2000
Datum: 04.05.15 11:37

Der rest
protected virtual double calculateAlphaFallout( double f )
		{
			return f * f * 0.8;
		}
 
		protected virtual Bitmap createReflectedBitmap(
			Bitmap bmpFramed,
			int height )
		{
			Bitmap bmpResult = new Bitmap( bmpFramed.Width, height );
 
			BitmapData bdS = bmpFramed.LockBits( 
				new Rectangle( Point.Empty, bmpFramed.Size ),
				ImageLockMode.ReadWrite,
				PixelFormat.Format32bppArgb );
			BitmapData bdD = bmpResult.LockBits(
				new Rectangle( Point.Empty, bmpResult.Size ),
				ImageLockMode.ReadWrite,
				PixelFormat.Format32bppArgb );
			unchecked
			{
				unsafe
				{
					int nWidthInPixels = bdD.Width * 4;
					for ( int y = height-1 ; y >= 0 ; y-- )
					{
						byte alpha = (byte)(255 * calculateAlphaFallout( (double)(height - y) / _
  height ));
						Pixel* pS = (Pixel*)bdS.Scan0.ToPointer() + bdS.Width * (bdS.Height - y - _
FrameWidth - 1);
						Pixel* pD = (Pixel*)bdD.Scan0.ToPointer() + bdD.Width * y;
						for ( int x = bdD.Width ; x > 0 ; x--, pD++, pS++ )
						{
							int R = gaussBlur( &pS->R, nWidthInPixels );
							int G = gaussBlur( &pS->G, nWidthInPixels );
							int B = gaussBlur( &pS->B, nWidthInPixels );
							pD->R = (byte)((R * 3 + G * 2 + B * 2) / 7);
							pD->G = (byte)((R * 2 + G * 3 + B * 2) / 7);
							pD->B = (byte)((R * 2 + G * 2 + B * 3) / 7);
							pD->A = alpha;
						}
					}
				}
			}
			bmpFramed.UnlockBits( bdD );
			bmpResult.UnlockBits( bdD );
 
			return bmpResult;
		}
 
		public static Size adaptProportionalSize( 
			Size szMax,
			Size szReal )
		{
			int nWidth;
			int nHeight;
			double sMaxRatio;
			double sRealRatio;
 
			if ( szMax.Width < 1 || szMax.Height < 1 || szReal.Width < 1 || _
  szReal.Height < 1 )
				return Size.Empty;
 
			sMaxRatio = (double)szMax.Width / (double)szMax.Height;
			sRealRatio = (double)szReal.Width / (double)szReal.Height;
 
			if ( sMaxRatio < sRealRatio )
			{
				nWidth = Math.Min( szMax.Width, szReal.Width );
				nHeight = (int)Math.Round( nWidth / sRealRatio );
			}
			else
			{
				nHeight = Math.Min( szMax.Height, szReal.Height );
				nWidth = (int)Math.Round( nHeight * sRealRatio );
			}
 
			return new Size( nWidth, nHeight );
		}
 
	}
0
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
Spiegel Bild einer PictureBox von C# ins VB1.454henrikl200004.05.15 11:35
Re: Spiegel Bild einer PictureBox von C# ins VB811henrikl200004.05.15 11:37
Re: Spiegel Bild einer PictureBox von C# ins VB764henrikl200004.05.15 11:37
Re: Spiegel Bild einer PictureBox von C# ins VB793Manfred X04.05.15 12:00
Re: Spiegel Bild einer PictureBox von C# ins VB895Manfred X04.05.15 13:34
Re: Spiegel Bild einer PictureBox von C# ins VB911henrikl200004.05.15 14:57
Re: Spiegel Bild einer PictureBox von C# ins VB785Manfred X04.05.15 15:32
Re: Spiegel Bild einer PictureBox von C# ins VB776henrikl200004.05.15 22:31
Re: Spiegel Bild einer PictureBox von C# ins VB816sv0001005.05.15 05:31
Re: Spiegel Bild einer PictureBox von C# ins VB697henrikl200005.05.15 08:10

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2025 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel