
-----------------------------------
Fexter
Mon Jan 30, 2012 12:55 pm

Saving an Image Background as Transparent?
-----------------------------------
What is it you are trying to achieve?
I want to use Turing to automate making pictures (Such as text) with transparent backgrounds (So I can easily bring them into other programs and not have to worry about the white of the background).

What is the problem you are having?
I can't seem to find any way to make the background transparent once I save my image.


Describe what you have tried to solve this problem
I tried looking through the Turing Documentation for something that would be able to do this, but didn't find anything. I also looked through the forum search, but all I could find was setting what colour is transparent for Turing.


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)



% My current code
% Displays 1 - 9, finds where it's located on the screen, then saves this with a random name

% Declare variables
var maxX, minX, maxY, minY, nameNum : int
var name : string

procedure saveScreen
    % The main part

    % Reset the min and max variables
    maxX := 0
    maxY := 0
    minX := maxx
    minY := maxy

    % Look through every square
    for x : 0 .. maxx
        for y : 0 .. maxy
            if whatdotcolor (x, y) not= white then
                if y < minY then
                    minY := y
                elsif y > maxY then
                    maxY := y
                end if
                if x > maxX then
                    maxX := x
                elsif x < minX then
                    minX := x
                end if
            end if
        end for
    end for

    % Move the min and max values by five; makes it have a bit of a border
    if minX - 5 >= 0 then
        minX -= 5
    end if
    if maxX + 5 = 0 then
        minY -= 5
    end if
    if maxY - 5 