Jump to content
Sign in to follow this  
seraph_nyc

Text

Recommended Posts

Hi Kaostika,

Sure, you can use:

Set Field [ containerField ; textField ]

Commit Records/Requests

But why would you want to do that instead of simply using the text field? Once you put text into a container, you lose the ability to modify or search that data.

LaRetta

Share this post


Link to post
Share on other sites

Hi,

Is there a way with [color:blue]scriptmaster to put text into a container.

Kaostika

Are you asking about ScriptMaker, or ScriptMaster, as in this product Link

If the later, then we should move it.

Lee

Share this post


Link to post
Share on other sites

Sharp eye, Lee!!

Share this post


Link to post
Share on other sites

Hi Kaostika,

You can do this if you combine the "Java Drawing Example" (in the example database that comes with ScriptMaster 2.08) with the "Gradient Image" example.

Add a third input variable "textstring" and modify the gradient code by including the creation of the text:

import java.awt.*;

import java.awt.image.*;

import javax.imageio.*;

int width=500;

int height=200;

Color c1 = Color.decode(color1);

Color c2 = Color.decode(color2);

GradientPaint gradient = new GradientPaint(0, 0, c1, width, height, c2);

BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);

Graphics2D g = img.createGraphics();

g.setPaint(gradient);

g.fillRect(0, 0, width, height);

// draw a transparent watermark string

g.setColor(new Color(0, 255, 255, 100));

g.setFont(new Font("Verdana", Font.BOLD, 24));

g.drawString(textstring, 100, 100);

return img;

You may have to play around with it to position the text nicely, either hard coding or adding more variables.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.