System.Drawing.TextureBrush.ResetTransform()

Here are the examples of the csharp api class System.Drawing.TextureBrush.ResetTransform() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

8 Examples 7

1. Example

Project: WzComparerR2
Source File: GearGraphics.cs
private static void FillRect(Graphics g, TextureBrush brush, int[] guideX, int[] guideY, int x0, int y0, int x1, int y1)
        {
            brush.ResetTransform();
            brush.TranslateTransform(guideX[x0], guideY[y0]);
            g.FillRectangle(brush, guideX[x0], guideY[y0], guideX[x1] - guideX[x0], guideY[y1] - guideY[y0]);
        }

2. Example

Project: WzComparerR2
Source File: GearTooltipRender2.cs
private void FillRect(Graphics g, TextureBrush brush, int x, int y0, int y1)
        {
            brush.ResetTransform();
            brush.TranslateTransform(x, y0);
            g.FillRectangle(brush, x, y0, brush.Image.Width, y1 - y0);
        }

3. Example

Project: PdfViewer
Source File: ShadeBorder.cs
public void Draw(Graphics graphics, Rectangle bounds)
        {
            if (_disposed)
         /n ..... /n //View Source file for more details /n }

4. Example

Project: PdfiumViewer
Source File: ShadeBorder.cs
public void Draw(Graphics graphics, Rectangle bounds)
        {
            if (_disposed)
         /n ..... /n //View Source file for more details /n }

5. Example

Project: duality
Source File: FontPreviewPropertyEditor.cs
protected override void OnPaint(PaintEventArgs e)
		{
			base.OnPaint(e);
			
			Rectangle rectPreview = this.ClientRectangle;
			Rectangle rectImage = new Rectangle(rectPreview.X + 1, rectPreview.Y + 1, rectPreview.Width - 2, rectPreview.Height - 2);
			Color brightChecker = this.prevImageLum > 0.5f ? Color.FromArgb(48, 48, 48) : Color.FromArgb(224, 224, 224);
			Color darkChecker = this.prevImageLum > 0.5f ? Color.FromArgb(32, 32, 32) : Color.FromArgb(192, 192, 192);
			e.Graphics.FillRectangle(new HatchBrush(HatchStyle.LargeCheckerBoard, brightChecker, darkChecker), rectImage);
			if (this.prevImage != null)
			{
				TextureBrush bgImageBrush = new TextureBrush(this.prevImage);
				bgImageBrush.ResetTransform();
				bgImageBrush.TranslateTransform(rectImage.X, rectImage.Y);
				e.Graphics.FillRectangle(bgImageBrush, rectImage);
			}

			ControlRenderer.DrawBorder(e.Graphics, 
				rectPreview, 
				BorderStyle.Simple, 
				!this.Enabled ? BorderState.Disabled : BorderState.Normal);
		}

6. Example

Project: duality
Source File: AudioDataPreviewPropertyEditor.cs
protected override void OnPaint(PaintEventArgs e)
		{
			base.OnPaint(e);
			
			Rectangle rectPreview = this.ClientRectangle;
			Color brightChecker = this.prevImageLum > 0.5f ? Color.FromArgb(48, 48, 48) : Color.FromArgb(224, 224, 224);
			Color darkChecker = this.prevImageLum > 0.5f ? Color.FromArgb(32, 32, 32) : Color.FromArgb(192, 192, 192);
			e.Graphics.FillRectangle(new HatchBrush(HatchStyle.LargeCheckerBoard, brightChecker, darkChecker), this.rectImage);
			if (this.prevImage != null)
			{
				TextureBrush bgImageBrush = new TextureBrush(this.prevImage);
				bgImageBrush.ResetTransform();
				bgImageBrush.TranslateTransform(this.rectImage.X, this.rectImage.Y);
				e.Graphics.FillRectangle(bgImageBrush, this.rectImage);
			}

			if (this.prevSoundInst != null)
			{
				e.Graphics.DrawImage(this.prevImageLum > 0.5f ? EditorBaseResCache.IconSpeakerWhite : EditorBaseResCache.IconSpeakerBlack, 
					this.rectPrevSound.X, 
					this.rectPrevSound.Y);
			}
			else
			{
				e.Graphics.DrawImageAlpha(this.prevImageLum > 0.5f ? EditorBaseResCache.IconSpeakerWhite : EditorBaseResCache.IconSpeakerBlack, 
					0.5f,
					this.rectPrevSound.X, 
					this.rectPrevSound.Y);
			}

			ControlRenderer.DrawBorder(e.Graphics, 
				rectPreview, 
				BorderStyle.Simple, 
				!this.Enabled ? BorderState.Disabled : BorderState.Normal);
		}

7. Example

Project: duality
Source File: TilesetView.cs
protected override void OnPaint(PaintEventArgs e)
		{
			base.OnPaint(e);
			Tileset tileset = this.tileset.Res;

			// Clear the background entirely
			e.Graphics.Clear(this.BackColor);
			
			// Fill with background pattern
			if (this.backBrush != null)
			{
				Point offset = this.GetTileIndexLocation(0);
				this.backBrush.ResetTransform();
				this.backBrush.TranslateTransform(offset.X, offset.Y);
				e.Graphics.FillRectangle(this.backBrush, this.ClientRectangle);
			}

			// Paint the tile layer, including the user interaction state
			this.OnPaintTiles(e);

			// Overlay with disabled plate
			if (!this.Enabled)
			{
				e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(128, this.BackColor)), this.ClientRectangle);
			}
		}

8. Example

Project: duality
Source File: ObjectRefPropertyEditor.cs
protected override void OnPaint(PaintEventArgs e)
		{
			base.OnPaint(e);

			this.SynchronizePrevie/n ..... /n //View Source file for more details /n }