Skip to content

Several drawing questions #2453

Answered by taublast
Antix-Development asked this question in Q&A
Discussion options

You must be logged in to vote

1 you can write from one canvas' surface to another canvas,:

srcSurface.Draw(destSurface.Canvas, destinationLeft, destinationTop, paint); //if you set paint color to white with alpha, you will draw with opacity of that alpha, like a semi-transparent layer

watch for size mismatch and commit changes srcSurface.Canvas.Flush() before copying if needed.

2 the logic when saving surface to file could be:

public Stream ToStream(SKSurface surface, SKEncodedImageFormat format = SKEncodedImageFormat.Jpeg, int quality = 90)
		{
			try
			{

				using (var image = surface.Snapshot())
				{
					var bitmap = SKBitmap.FromImage(image);
					var rotated = Reorient(bitmap);

					var data = rotated.Encode…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Antix-Development
Comment options

Answer selected by Antix-Development
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants