Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

CaptureScreenshotAsTexture and print screen

Discussion in 'Windows' started by Sadowski, Jul 19, 2019.

  1. Sadowski


    Jan 20, 2017
    I have a big request. i`m a graphic designer using Playmaker and never write a line of code. and I have a problem. I have an asset and I do not know how to implement
    "LCPrinter plugin allows you to print a Texture2D to your printer.
    It only requires one line of code to print an image."

    LCPrinter.Print.PrintTexture(texture2D.EncodeToPNG(), copies, printerName);

    That functions just returns the Texture2D then you jus need to pass it to our print funciton.
    public static Texture2D CaptureScreenshotAsTexture(int superSize);

    I need a procedure called by "call method" which prints the whole screen multiplied by (2 or 3)

    example script
    using UnityEngine;
    using System.Collections;
    using System.Diagnostics;
    using System;
    using System.IO;
    using LCPrinter;
    using UnityEngine.UI;

    public class LCExampleScript : MonoBehaviour {

    public Texture2D texture2D;
    public string printerName = "";
    public int copies = 1;

    public InputField inputField;

    public void printSmileButton()
    Print.PrintTexture(texture2D.EncodeToPNG(), copies, printerName);

    public void printByPathButton()
    Print.PrintTextureByPath(inputField.text.Trim(), copies, printerName);

    I got stuck and I would be grateful for any help. Please, keep in mind that I'm not a coder.
    Rafał Sadowski