Try / Catch
try { write-host "Hier wird was versucht, was schief gehen kann, z.B. Division durch 0" $a = 1/0 } catch { write-host "Fehler abgefangen: `r`n $_.Exception.Message" } finally { write-host "Finalize wird immer ausgeführt" } # Der Fehler wird zusaetzlich auch in $error hinterlegt write-host $Error
https://talkingpdf.org/forms-data-format-fdf/
http://www.lagotzki.de/pdftk/index.html#burst_cat
https://www-user.tu-chemnitz.de/~hot/pdf_formulare/
https://wiki.ubuntuusers.de/pdftk/
# Funktion deklarieren function testfunktion ([int]$zahl){ #Auszuführende Anweisung $ergebnis = $zahl * 2 #Ergebnis ausgeben / zurück geben return $ergebnis } # Funktion aufrufen testfunktion(80)
Run only as Admin
if (! ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { throw "Run with administrator rights" }
Here's the trick: a raycasting engine doesn't draw the whole scene at once. Instead, it divides the scene into independent columns and renders them one-by-one. Each column represents a single ray cast out from the player at a particular angle. If the ray hits a wall, it measures the distance to that wall and draws a rectangle in its column. The height of the rectangle is determined by the distance the ray traveled - more distant walls are drawn shorter.
http://www.playfuljs.com/a-first-person-engine-in-265-lines/ - Via reddit .comWas ist PlayCanvas eigentlich?
Es ist eine JavaScript-Bibliothek, die speziell für den Aufbau von Videospielen entwickelt. Es implementiert alle wichtigen Komponenten wie:
- Graphics: model loading, per-pixel lighting, shadow mapping, post effects
- Physics: rigid body simulation, ray casting, joints, trigger volumes, vehicles
- Animation: keyframing, skeletal blending, skinning
- Audio engine: 2D and 3D audio sources
- Input devices: mouse, keyboard, touch and gamepad support
- Entity-component system: high level game object management
Weiter Links:
Samples, API Referenze, Developer Resources, Anleitungen
OrginalText codeproject.com
using System; using System.Drawing; using System.Drawing.Imaging; namespace ImageUtils { class ImageTransparency { public static Bitmap ChangeOpacity(Image img, float opacityvalue) { Bitmap bmp = new Bitmap(img.Width,img.Height); // Determining Width and Height of Source Image Graphics graphics = Graphics.FromImage(bmp); ColorMatrix colormatrix = new ColorMatrix(); colormatrix.Matrix33 = opacityvalue; ImageAttributes imgAttribute = new ImageAttributes(); imgAttribute.SetColorMatrix(colormatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap); graphics.DrawImage(img, new Rectangle(0, 0, bmp.Width, bmp.Height), 0, 0, img.Width, img.Height, GraphicsUnit.Pixel, imgAttribute); graphics.Dispose(); // Releasing all resource used by graphics return bmp; } } }
pictureBox1.Image = ImageUtils.ImageTransparency.ChangeOpacity(Image.FromFile("filename"),opacityvalue);Fade mit Alpha.
OrginalText stackoverflow.com
int alpha = 0;
private void timer1_Tick(object sender, EventArgs e) { if (alpha++ < 255) { Image image = pictureBox1.Image; using (Graphics g = Graphics.FromImage(image)) { Pen pen = new Pen(Color.FromArgb(alpha, 255, 255, 255), image.Width); g.DrawLine(pen, -1, -1, image.Width, image.Height); g.Save(); } pictureBox1.Image = image; } else { timer1.Stop(); } }Fade mit Blur Effekt.
OrginalText Josh Jordan
public static Bitmap Fade(Bitmap image1, Bitmap image2, int opacity) { Bitmap newBmp = new Bitmap(Math.Min(image1.Width,image2.Width), Math.Min(image1.Height,image2.Height)); for (int i = 0; i < image1.Width & i < image2.Width; i++) { for (int j = 0; j < image1.Height & j < image2.Height; j++) { Color image1Pixel = image1.GetPixel(i, j), image2Pixel = image2.GetPixel(i, j); Color newColor = Color.FromArgb( (image1Pixel.R * opacity + image2Pixel.R * (100 - opacity) ) / 100, (image1Pixel.G * opacity + image2Pixel.G * (100 - opacity) ) / 100, (image1Pixel.B * opacity + image2Pixel.B * (100 - opacity) ) / 100); newBmp.SetPixel(i, j, newColor); } } return newBmp;
int trans = 30; pictureBox1.Image = Fade(new Bitmap(imgOld), new Bitmap(imgNew), trans);
jQuery.fn.centerFix = function () { this.css("position","absolute"); this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px"); this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px"); return this; } $('.div').centerFix();Via der-webentwickler.net
Tags: jQuery, zentrieren
ReferenceError: $ is not defined $(document).ready(function() {Die Reihenfolge der abzuarbeitenden jQuery-Scripte sollte eingehalten werden. Der Verweis auf das jQuery-Script erfolgt an erster Stelle. Erst danach kann auf das eigene "nachfolgende" JavaScript-Script zugegriffen werden.
script type='text/javascript' src='jquery.min.js' script type='text/javascript' src="meinscript.js'