Placed image hides graphic objects on master
Mac OS 10.8 \ ID CS5
Rectangular frame created on master \ photo corners created in InDesign for each of the four corners
In the document page when an image is placed in the frame, the image hides the portion of the corners that lie within the frame
I tried bring to front for corners - no joy - can't seem to send frame to back
I can copy the corners from the master page and paste in place on the document page - works fine - full corners show with image below
With 50-75 anticipated pages and about 75 photos, I need a better way. Help, please?
Message was edited by: FroggyGreen
Make a new layer (above the current one).
Go to your Master page and move the elements you want in front to the new layer.
Similar Messages
-
Draw to an image using graphics object
ive been trying to this. create a starfield 800px wide and twice the height of the screen 2x600. this image would be scrolling down the screen giving the appearance of moving through space. what i did was create an image the called "starField", and created a graphics object "starFieldObj" to draw dots (stars) to this image.
is this the correct way to do this? my program seems to work differently depending on where i call "generateStarField()" which draws to "starFieldObj"
import java.awt.*;
import java.awt.event.*;
import java.util.*;
public class Alpha1 extends Canvas implements Runnable, MouseMotionListener, MouseListener, KeyListener {
private Image buffer; //bufer image
private Graphics gfx;
private Graphics starFieldObj;
private Image playerShip;
private int frames = 60; //frames per second
private MediaTracker mediaTracker; //tracks loaded images
private boolean ready; //ready to start animation
private int [] keys = new int[256];
private int playerShipX = 100;
private int playerShipY = 100;
private static Random random = new Random();
private Image starField;
private int starFieldSpeed = 5;
private int starFieldX = 0;
private int starFieldY = -600;
public static void main(String[] args)
Alpha1 t = new Alpha1();
Frame f = new Frame("blah");
f.setSize(800, 600);
f.add(t, BorderLayout.CENTER);
f.show();
t.start();
t.requestFocus();
f.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);}});
public Alpha1()
addKeyListener(this);
addMouseListener(this);
ready = false;
mediaTracker = new MediaTracker(this);
playerShip = getToolkit().getImage("testship1.png");
//starField = getToolkit().getImage("testbg.png");
//mediaTracker.addImage(playerShip, 0);
mediaTracker.addImage(starField, 0);
try {
mediaTracker.waitForID(0);
catch (InterruptedException e) {
e.printStackTrace();
public void start()
buffer = createImage(getSize().width,getSize().height);
//starField = createImage(getSize().width,getSize().height * 2);
gfx = buffer.getGraphics();
//starFieldObj = starField.getGraphics();
generateStarfield();
ready = true;
new Thread(this).start();
public void mouseDragged(MouseEvent e) {}
public void mouseMoved(MouseEvent e)
playerShipX = e.getX();
playerShipY = e.getY();
public void mouseReleased(MouseEvent e) {}
public void mousePressed(MouseEvent e) {}
public void mouseExited(MouseEvent e) {}
public void mouseEntered(MouseEvent e) {}
public void mouseClicked(MouseEvent e) {}
public void keyTyped(KeyEvent keyevent) {}
public void keyPressed(KeyEvent keyevent)
keys[keyevent.getKeyCode()] = 1;
System.out.println(keyevent.getKeyCode());
public void keyReleased(KeyEvent keyevent)
keys[keyevent.getKeyCode()] = 0;
public void run()
while (true)
if (isVisible())
repaint();
updatePositions();
}//end if
try
{ Thread.sleep(1000/frames); }
catch (InterruptedException e)
{ e.printStackTrace(); }
}//end while
public void paint(Graphics g) { /*empty etc*/ }
public void updatePositions()
if (keys[38] == 1 & keys[40] == 0) //IF UP IS PRESSED
{ playerShipY -= 3; }
if (keys[40] == 1 & keys[38] == 0) //IF DOWN IS PRESSED
{ playerShipY += 6; }
if (keys[37] == 1 & keys[39] == 0) //IF LEFT IS PRESSED
{ playerShipX -= 5; }
if (keys[39] == 1 & keys[37] == 0) //IF RIGHT IS PRESSED
{ playerShipX += 5; }
//starFieldY = starFieldY + starFieldSpeed;
//if (starFieldY == 0)
// starFieldY = -600;
// System.out.println("dadssa");
public int getRandom(int from, int to)
if (from > to)
int randTemp;
randTemp = from;
from = to;
to = randTemp;
return random.nextInt(to-from+1)+from;
public void generateStarfield()
starFieldObj.setColor(Color.black);
starFieldObj.fillRect (0, 0, 800, 600 * 2);
for (int td=0; td < 900 ; td++) //draw 900x2 dots on 800x1200 image
starFieldObj.fillRect (getRandom(1,800), getRandom(1,600), 1, 1);
starFieldObj.fillRect (getRandom(1,800) + 800, getRandom(1,600) + 800, 1, 1);
public void update(Graphics g)
if (ready)
gfx.setColor(Color.black);
gfx.fillRect (0, 0, this.getSize().width, this.getSize().height);
//gfx.drawImage(starField,starFieldX,starFieldY,null);
gfx.drawImage(playerShip,playerShipX,playerShipY,null);
//gfx.drawString(Integer.toString(showFps),5,5);
g.drawImage(buffer,0,0,null);
}updated code, i cant get starField to be 1200px in height
import java.awt.*;
import java.awt.event.*;
import java.util.*;
public class Alpha1 extends Canvas implements Runnable, MouseMotionListener, MouseListener, KeyListener {
private Image buffer; //bufer image
private Graphics gfx;
private Graphics starFieldObj;
private Image playerShip;
private int frames = 60; //frames per second
private MediaTracker mediaTracker; //tracks loaded images
private boolean ready; //ready to start animation
private int [] keys = new int[256];
private int playerShipX = 100;
private int playerShipY = 100;
private static Random random = new Random();
private Image starField;
private int starFieldSpeed = 5;
private int starFieldX = 0;
private int starFieldY = -600;
public static void main(String[] args)
Alpha1 t = new Alpha1();
Frame f = new Frame("blah");
f.setSize(800, 600);
f.add(t, BorderLayout.CENTER);
f.show();
t.start();
t.requestFocus();
f.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);}});
public Alpha1()
addKeyListener(this);
addMouseListener(this);
ready = false;
mediaTracker = new MediaTracker(this);
playerShip = getToolkit().getImage("testship1.png");
//starField = getToolkit().getImage("testbg.png");
//mediaTracker.addImage(playerShip, 0);
mediaTracker.addImage(starField, 0);
try {
mediaTracker.waitForID(0);
catch (InterruptedException e) {
e.printStackTrace();
public void start()
buffer = createImage(getSize().width,getSize().height);
starField = createImage(getSize().width,1200);
gfx = buffer.getGraphics();
starFieldObj = starField.getGraphics();
ready = true;
new Thread(this).start();
public void mouseDragged(MouseEvent e) {}
public void mouseMoved(MouseEvent e)
playerShipX = e.getX();
playerShipY = e.getY();
public void mouseReleased(MouseEvent e) {}
public void mousePressed(MouseEvent e) {}
public void mouseExited(MouseEvent e) {}
public void mouseEntered(MouseEvent e) {}
public void mouseClicked(MouseEvent e) {}
public void keyTyped(KeyEvent keyevent) {}
public void keyPressed(KeyEvent keyevent)
keys[keyevent.getKeyCode()] = 1;
System.out.println(keyevent.getKeyCode());
public void keyReleased(KeyEvent keyevent)
keys[keyevent.getKeyCode()] = 0;
public void run()
generateStarfield();
while (true)
if (isVisible())
repaint();
updatePositions();
}//end if
try
{ Thread.sleep(1000/frames); }
catch (InterruptedException e)
{ e.printStackTrace(); }
}//end while
public void paint(Graphics g) { /*empty etc*/ }
public void updatePositions()
if (keys[38] == 1 & keys[40] == 0) //IF UP IS PRESSED
{ playerShipY -= 3; }
if (keys[40] == 1 & keys[38] == 0) //IF DOWN IS PRESSED
{ playerShipY += 6; }
if (keys[37] == 1 & keys[39] == 0) //IF LEFT IS PRESSED
{ playerShipX -= 5; }
if (keys[39] == 1 & keys[37] == 0) //IF RIGHT IS PRESSED
{ playerShipX += 5; }
starFieldY = starFieldY + starFieldSpeed;
if (starFieldY == 0)
starFieldY = -600;
System.out.println("dadssa");
public int getRandom(int from, int to)
if (from > to)
int randTemp;
randTemp = from;
from = to;
to = randTemp;
return random.nextInt(to-from+1)+from;
public void generateStarfield()
starFieldObj.setColor(Color.black);
starFieldObj.fillRect (0, 0, 800, 1200);
for (int td=0; td < 900 ; td++) //draw 900x2 dots on 800x1200 image
starFieldObj.setColor(Color.white);
starFieldObj.fillRect (getRandom(1,800), getRandom(1,600), 1, 1);
starFieldObj.fillRect (getRandom(1,800) + 800, getRandom(1,600) + 800, 1, 1);
public void update(Graphics g)
if (ready)
gfx.setColor(Color.black);
//gfx.fillRect (0, 0, this.getSize().width, this.getSize().height);
gfx.drawImage(starField,starFieldX,starFieldY,null);
gfx.drawImage(playerShip,playerShipX,playerShipY,null);
//gfx.drawString(Integer.toString(showFps),5,5);
g.drawImage(buffer,0,0,null);
} -
Placing Images Infront of Objects
So I want to place my thumbnail gallery infront of a giant black bar that I have which encases the images.
this black bar was created using the rectangle tool and then filled in with black and opacity brought down to 30%, then it is placed on top of the thumbnail gallery but I cant select any of the images because I am assuming this bar is now infront of it.
I have tried both sending to back and front
as well as sending to Master foreground and Master background
If I send the black bar to Masterbackground for some reason it sends it behind the large image I have displayed with the thumbnails.
Also if Text is in this black bar, I can select the text box but for some reason I cant select the thumbnail box in it
Help?Yes I sure can
The First image you see shows two pictures in one
The bottom shows my contact and home which is red meaning its in the foreground
and the thumbnail above (same master page) shows it in blue with no option (grayed out) to send to foreground
When I go to my slave page I do not have the option to even edit anything pre existing (Unlock everything on page and still nothing)
So I am stuck editing on my masterpage which does not work with what Aishvarya said
What Am I doing wrong here? -
Canvas - Graphic object properties
The problem is as following:
I’ve got a form where objects are situated on two tab pages. A number of text_items are placed on rectangle graphic objects. My goal is to control visibility of those objects depending on certain conditions:
With text items correctly works:
QUANTITY_ID ITEM;
QUANTITY_ID := find_item('PRODUCT.QUANTITY');
set_item_property (QUANTITY_ID, visible, property_false);
With graphics object I’m facing the problem with reaching the item:
G_QUANTITY_ID ITEM;
G_QUANTITY_ID := find_item('?????????????.G_QUANTITY');
Placement of the object:
Forms -> Canvases -> Tab Pages -> [Product] -> Graphics -> [G_QUANTITY]
Where:
[Product] – Name of the tab page
[G_QUANTITY] – Rectangle graphic object
I’ll appreciate any kind of help. Thanks in advance.Hello,
There is no available built-in concerning the graphic objects displayed on the canvas. All you can do use another stacked canvas to show/hide the graphic objects located on it.
Francois -
Is it possible to hide an object on a masterpage dynamically?
hello,
is it possible to hide an object on a masterpage dynamically?
I tried to define a formula in the script editor with FormCalc, but it doesn't work. I made a similiar definition within the content area and this definition is working.
It is a HCM form and the following formular is defined in the initialization event of the object:
if( Exists($record.DIM_EMPLOYEE.DATA[*].FIRE_DATE[0]) == 0 ) then
$.presence = "hidden"
endif
Can anybody help me , please?
Regards,
TanjaWell YES it is possible to hide an object of master page. Couple of things you can try:-
1. Use quotes around zero. i.e.
if( Exists($record.DIM_EMPLOYEE.DATA[*].FIRE_DATE[0]) == "0" ) then
2. Use fully qualified names for the object of Master Page and place the event in form:ready event of the subform instead of master page.
Also I tried a small example and it worked. Sample Hierarchy is shown below
form1
|-- Master Pages
|-- Page1
|-- Content Area
|-- TextField1
|-- (untitled subform) (page1)
|-- TextField2
JS code on the exit event of TextField2
form1.#subform[0].TextField2::exit - (JavaScript, client)
if(this.rawValue == "1")
form1.pageSet.Page1.TextField1.presence = "hidden"; -
Getting the filename of a placed image inside a smart object
Hi
I'm wondering if I can get any help with a problem I'm trying to overcome for a friend of mine.
My friend is a photographer who does a lot of schhols work (pupil portraits) and wants to create a little document similar to this (very simplified) version:
I'm trying to help him to create a batch process so that he can make this take up much less of his time!
Here's where I've got to so far. I've created the layout above which is essentially a smart object (from an external file) manipulated in a couple of ways.
The workflow as I see it at the moment (although I'm wide open to suggestions, and I'm having a bit of Friday brain) is this: I generate an action that replaces the content of the external file with the contents of (each file in his incoming list, sequentially).
That file then comes back into the layout above and a new (flattened) copy is saved out from there.
Rinse and rerpeat through the list of incoming files.
I can just about make that bit happen using actions, but here's what I can't get - the filename of the incoming file (the one that's placed in the smart object). Can I can use a modified version of the AddFileName script to generate a text layer based on the filename of the placed contents in the smart object? Does any of that make sense? I'm reading this back to myself and even I'm not sure! ho ho.
My lack of logic/coherent sentence structure here is what probably holds me back in any eforts I have made in getting into scripting.
I'd appreciate any help that could be offered.
Thanks.
FentonAh - alas it sems not to be. I think I am going to have to come up with a different workflow and by extension, solution. My current thinking is that I need to have an input folder for the images to be used in the layout, and an output folder for the results to be saved into, along with the layout.psd (as above) all housed in the same folder. Then I need (help) to write a script that does the following:
Checks that the layout document is open (that bit is easy enough)
if(documents.length==0){
alert("You need to have your layout template open (-layout.psd-)")
}else{
// Do next bit here - and what I'm trying to do is described below.
// Hopefully by typing it out I might start to get it straight in my head
// Any help with any part of this process is greatluy appreciated
// I'm trying to learn!
Then what I think the script needs to do is tocheck the contents of the input folder and find out how many files are in it then set this as a variable, to set the length of a loop, maybe? Or should it load the filenames as an array and work through them sequentially?
Once that information is established, there is a smart object on the first layer that needs to be updated with the contents of the first file - my thinking s that this is done by the script opening each image, and then copy/pasting into the smart object, merging down (so I don't end up with an enormous multi-layered file). My reason for thinking this would be a good idea would be that I could just run a quick check to make sure that no landscape pics have sneaked in there and if they have, rotate them (which again, is pretty easy as even I could do that bit, too).
doc = activeDocument;
if (doc.height < doc.width) {
doc.rotateCanvas(90);
} else {
// Carry on
This will update all of the smart object instances throughout the layout template.
Then the text underneath the main image needs to be updated with the filename of the file that has been pasted in the smart object, and after that a [flattened] copy saved out to an output folder.
Rinse and repeat for the remaining images in the input folder.
Any thoughts?
Thanks
Fenton -
Hi, I'm dealing with the Batik API for working with svg images, but I need to do some wmf imager representation too.
This API offers a class which is able to read WMF files, giving a "WMFRecordStore", that you can use to initialize a "WMFPainter".
Anyway, this WMFPainter class has a "paint" method which I hoped that I could use to print the wmf info in the screen but... I don't know if it can be done.
You must pass a Graphics object to the "paint" method.
If I want to add an image to a JLabel, as I'd do with an ImageIcon, do I have to get the current JLabel Graphics object? Will the image keep displayed when repainting? Is this a correct way of doing this?
thanks a lotif you have to paint special things on a component, you have to subclass the component and override the paint (or paintComponent) method. You don't want to be getting the graphics object from a component and draw on it, it's not going to work properly.
-
Change stacking order of placed images/objects?
Hello All,
Is it possible to change the order of placed images in a PDF?
I have a PDF with several objects in it, I want to be able to place an image into the PDF, and have it appear behind some of the objects and in front of others... is this possible?
Example, let's say I have a PDF with a cartoon/comic word or thought bubble in it... I want to be able to place an image of my friend behind the word bubble object.
I have Acrobat 9.0 Pro
Thanks!As far as AS3 goes, I don't know what you mean, but it can be used pretty much the same way you use AS2, with the exception that in AS3 you cannot place code "on" object like you can in AS1/AS2... all code must be on the timeline. Beyond that, there is no difference beyond alot of the code being different between the two languages. The timeline remains as a place to build things in if you choose to.
As far as your question goes, yes, you can have a rollover of a movieclip assign text to a textfield within it. Let's say you're using AS2 and you have a movieclip named "button1" that contains a textfield named "tf1". Code for that could be...
button1.onRollOver = function(){
button1.tf1.text = question1;
And if you wanted to make tit so that clicking that same button shows the answer....
button1.onRelease = function(){
button1.tf1.text = answer1; -
Getting the image of a graphics object?
Hi,
I have a graphics object that I want to update on a thread, but i don't want to redraw everything I had on each time I update (I only want to draw new items). in my paintComponent function, I have
public void paintComponent(Graphics g)
Graphics2D g2 = (Graphics2D)g;
if (bufferedImage == null)
bufferedImage = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB);
g2.drawImage(bufferedImage, 0, 0, null);
drawBackground(g2);
addItem(g2);
g2_ = g2;
}where drawBackground makes the constant background and addItem draws new points. The problem that I'm having is that it is only drawing new items on the graph and not adding on to the existing image. I think this is because I never set bufferedImage to the current image, but I'm not sure how to do this?
Thanksdemo:
import java.awt.*;
import java.awt.image.*;
import javax.swing.*;
@SuppressWarnings("serial") public class Example extends JComponent {
private BufferedImage buffer;
setOpaque(true);
@Override protected void paintComponent(Graphics g) {
int w = getWidth(), h = getHeight();
if (buffer == null ||
w > buffer.getWidth() || h > buffer.getHeight()) {
buffer = getGraphicsConfiguration().createCompatibleImage(w, h);
composeBuffer();
g.drawImage(buffer, 0, 0, null);
protected void composeBuffer() {
Graphics2D g2 = buffer.createGraphics();
g2.setColor(Color.RED);
g2.drawLine(0, 0, buffer.getWidth(), buffer.getHeight());
g2.dispose();
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable(){
public void run() {
JComponent comp = new Example();
comp.setPreferredSize(new Dimension(400,300));
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.add(comp);
f.pack();
f.setLocationRelativeTo(null);
f.setVisible(true);
} -
How to convert a Graphics object into a JPG image?
I have this simple question about how to make a Graphics object into a JPG file...
I just need the names of the classes or the packages ... I'll figure out the rest of the details...
Thanks...Anyway this might come in handy
JPEGUtils.java
============
* Created on Jun 22, 2005 by @author Tom Jacobs
package tjacobs.jpeg;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.awt.image.RenderedImage;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.imageio.ImageIO;
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGEncodeParam;
import com.sun.image.codec.jpeg.JPEGImageDecoder;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
* Utilities for saving JPEGs and GIFs
public class JPEGUtils {
private JPEGUtils() {
super();
public static void saveJPEG(BufferedImage thumbImage, File file, double compression) throws IOException {
BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(file));
saveJPEG(thumbImage, out, compression);
out.flush();
out.close();
public static void saveJPEG(BufferedImage thumbImage, OutputStream out, double compression) throws IOException {
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(thumbImage);
compression = Math.max(0, Math.min(compression, 100));
param.setQuality((float)compression / 100.0f, false);
encoder.setJPEGEncodeParam(param);
encoder.encode(thumbImage);
public static BufferedImage getJPEG(InputStream in) throws IOException {
try {
JPEGImageDecoder decode = JPEGCodec.createJPEGDecoder(in);
BufferedImage im = decode.decodeAsBufferedImage();
return im;
} finally {
in.close();
public static BufferedImage getJPEG(File f) throws IOException {
InputStream in = new BufferedInputStream(new FileInputStream(f));
return getJPEG(in);
public static void saveGif(RenderedImage image, File f) throws IOException {
saveGif(image, new FileOutputStream(f));
public static void saveGif(RenderedImage image, OutputStream out) throws IOException {
// Last time I checked, the J2SE 1.4.2 shipped with readers for gif, jpeg and png, but writers only for jpeg and png. If you haven't downloaded the whole JAI, and you want a writer for gif (as well as readers and writers for several other formats) download:
// http://java.sun.com/products/java-media/jai/downloads/download-iio.html
ImageIO.write(image, "gif", out);
public static void main(String[] args) {
// TODO Auto-generated method stub
} -
How to place raster images as smart objects?
I'm trying to duplicate Photoshop's File:Place menu functionality and I'm experiencing something that I can't figure out. (I've added my code to the end of this message.)
I have a variety of test EPS images that I can run through the File:Place menu. They all appear on the document as "Smart Objects". That is I can then do a bunch of transforms to the image (like rotate, move, deform) before committing to the image to the document.
The important point here is that some images, when opened by Photoshop, first ask that I "Rasterize EPS Format" while others just open up without comment.
While doing these File:Place actions, I've been using the Listener plugin that comes with the SDK to generate code dumps of my actions. From these I've then generated my own code for placing images onto a document. I've had to re-arrange the code a bit to work in Objective-C so there's a good chance that I've done something wrong while translating.
Now if you look at my code you notice a commented out section. If you uncomment those lines then you basically have what I got from the Listener plugin log. But the problem is that this code then doesn't act like the File:Place menu action. It creates a new layer, places the image on the page - but its gone one step too far and the image is no longer a "Smart Object". The image is committed to the layer.
With a bit of experimenting I commented out the line that you can see commented out in my code. However, this does something odd. For all images you can see Photoshop put up a busy icon for a few seconds showing that it is process, but only images that Photoshop wants to "Rasterize EPS Format" actually appear on the page as Smart Objects. Trying to place the images that Photoshop doesn't rasterize results in nothing appearing.
That's my problem. If I uncomment that line in my code then all images that I test with appear on the page - but not as Smart Objects. If I comment out the code then only images that Photoshop wants to rasterize appear - but those that do appear then appear as Smart Objects.
So that's my goal: to place any image onto a document as a Smart Object just like Photoshop's File:Place menu command does. Any ideas where I'm going wrong?
- (SPErr)photoshopPlayeventPlace:(char *)cPath
PIActionDescriptor result = NULL;
Auto_Desc descriptor;
Auto_Desc offsetDetails;
SPErr error = kSPNoError;
Handle aliasValue = NULL;
FullPathToAlias(cPath, aliasValue);
do
error = sPSActionDescriptor->PutAlias(descriptor.get(), keyNull, aliasValue);
if (error) break;
// error = sPSActionDescriptor->PutEnumerated(descriptor.get(), keyFreeTransformCenterState, typeQuadCenterState, enumQCSAverage);
// if (error) break;
error = sPSActionDescriptor->PutUnitFloat(offsetDetails.get(), keyHorizontal, unitDistance, 0);
if (error) break;
error = sPSActionDescriptor->PutUnitFloat(offsetDetails.get(), keyVertical, unitDistance, 0);
if (error) break;
error = sPSActionDescriptor->PutObject(descriptor.get(), keyOffset, classOffset, offsetDetails.get());
if (error) break;
error = sPSActionControl->Play(&result, eventPlace, descriptor.get(), plugInDialogSilent);
if (error) break;
while (false);
if (result != NULL) sPSActionDescriptor->Free(result);
if (aliasValue != NULL) sPSHandle->Dispose(aliasValue);
return error;If you want to go with Batch I would recommend creating an Action of more or less these steps:
• set the resolution to the same as the background image’s
• change the image from Background Layer to regular Layer if necessary
• convert it to a Smart Object
• add a Drop Shadow Layer Style to the image (do not use Global Angle)
• place the background image (File > Place …)
• move it behind the image layer
• Image > Reveal All
• make Selection from that layer’s transparency (cmd-click its icon in the Layers Panel) and use Image > Crop
• select and transform the image layer to fit the intended position
This would naturally work out best if the images had the same size and proportions.
For the reflection on the floor duplicate the image, flip it vertically, move it in position and reduce its opacity to maybe 10%.
Realistically you may have to hide it partially behind the pillows, a Vector Mask would be an option. -
Add Strokes to Placed Images in Illustrator
Hi All,
I'm having a problem to add a stroke "frame" around my tiff image in Illustrator. My image is a "traced picture" from Photoshop. I used the following technique:-
Technique: Use an Effect
Choose File > Place and select an image to place into Illustrator document.
Choose File > Place and select an image to place into Illustrator document.
The image is selected. Open Appearance panel and from the Appearance panel flyout menu, choose Add New Stroke.
With the Stroke highlighted in the Appearance panel, choose Effect > Path > Outline Object.
However, the result I got was the stroke around the image NOT the frame around the image.
How do I achieve it. Any help and tips are greatly appreciated. Thanks in advance.Technique #1: Use a Mask
This technique requires Illustrator CS3 and works only when your keyline will be rectangular in shape.
Choose File > Place and choose an image to place into your Illustrator document. You can either Link or Embed the image. Once you've chosen the image, click the Place button.
The image is selected (if your image already exists in your document, select it now), so if you look in your Control panel at the top of the screen, you'll see a button labeled "MASK". Click on it. This creates a mask at the exact bounds of the image.
Press the "D" key for Default. This gives the mask a black 1 pt stroke attribute. Adjust the stroke per your design needs.
NOTE: An additional benefit to this method of using a mask is that you now have the elements in place to simulate a "frame and image" paradigm like InDesign. Once you've created your mask, you can decide to "crop" your image by double clicking anywhere on the photo. This will put you into Isolation Mode. Now click on the frame edge and resize at will. When you're done, double click outside the image to exit isolation mode and continue working. This method works wonderfully when you're using the Selection tool (black arrow) and have the Bounding Box option turned on (in the View menu).
Technique #2: Use an Effect
At first, it may seem that applying a keyline with the use of an Effect is a tedious process. But we all know that once we've applied an effect, we can store it as a Graphic Style, at which point applying our keyline will become a single click. Go ahead, ask me why Adobe doesn't ship Illustrator with such an effect as a default setting in the NDPs (New Document Profiles). Go ahead, ask me why Adobe doesn't allow us to assign keyboard shortcuts to styles like InDesign does. I don't have answers to either of those questions (sorry). But let's get on with the styles, shall we?
There are two separate effects that we can use, and each provides a different benefit.
Choose File > Place and select an image to place into your Illustrator document. You can either Link or Embed the image. Once you've chosen the image, click the Place button.
The image is selected (or if your image already exists in your document, select it). Open your Appearance panel and from the Appearance panel flyout menu, choose Add New Stroke. We can't see the stroke yet, because all we have is an image. But we'll change that in short order.
With the Stroke highlighted in the Appearance panel, choose Effect > Convert to Shape > Rectangle. Check the Preview button, select the Relative option, and set both the Extra Width and Extra Height to zero (0). (Be careful not to press Tab after you enter the second value, or it will switch back to Absolute.) Click OK to apply the effect. Style the stroke attribute to match your design preference.
Now make this easier to apply in the future. With the object still selected, open the Graphic Styles panel and click the New Graphic Style button at the bottom of the panel. Give the style an appropriate name. If you then add this style to your NDPs, it will be readily available in all new files that you create.
Add Strokes to Placed Images in Illustrator | CreativePro.com -
I cant get it to work! NullPointerExeption at first awt.Graphics Object
I am writing a game with AWT having it as an applet. I intend NOT to use anything outside of Java 1.1
For my Game i thought that i ATLEAST need the following classes:
MainGame, Level, Unit.
I Started writing Level. wrote a fewe methods for it such as
drawGras(int grastype) And started to write MainGame to see if they would work together. it's is/is going to be my first Java application where i actually know what object orienting is... I have already wrote a game in Java but with out knowing what a class or what object orienting realy is(the game works rather good to) but this time i wanted to use object orienting but came up with problems =( if first posted in "New to Javaprogramming" but they couldn't help me and advice me here
My previous post: http://forum.java.sun.com/thread.jsp?forum=54&thread=290558
Here's my code:
import java.awt.*;
public class MainGame extends java.applet.Applet
implements Runnable {
Thread runner;
Image ImgLevel, ImgUnit;
public MainGame() {
Level nr1 = new Level();
nr1.init();
nr1.setGround(300);
nr1.drawGras(1);
nr1.CalcGraphics();
nr1.drawSky(1);
Image ImgLevel = nr1.getLevelImage();
public void paint(Graphics g) {
g.drawImage(ImgLevel,0,0,this);
public void update(Graphics g) {
paint(g);
public void init() {
MainGame Game = new MainGame();
public void stop() {
runner = null;
System.exit(1);
public void start() {
if(runner == null) {
runner = new Thread(this);
runner.start();
void Pause(int time) {
try {
Thread.sleep(time);
} catch(InterruptedException e) {
System.out.println(e.toString());
public void run() {
Thread thisThread = Thread.currentThread();
while(thisThread == runner) {
class Level extends java.applet.Applet {
Font BigText = new Font("Arial", Font.PLAIN, 36);
Font Normal = new Font("Arial", Font.PLAIN, 14);
Font Bold = new Font("Arial", Font.BOLD, 14);
Graphics GrLevel;
int pattern, sky, GroundtoWalk, Ground;
Color BgColor = new Color(166,202,240);
Color gras1 = new Color(0,255,0);
Color gras2 = new Color(0,200,0);
Color gras3 = new Color(0,100,0);
Image ImgLevel;
void setBgColor(int r, int g, int b) {
BgColor = new Color(r,g,b);
void CalcGraphics() {
ImgLevel = createImage(800,600);
GrLevel = ImgLevel.getGraphics();
void setGround(int GrounD) {
Ground = GrounD;
void GroundToWalkADD(int addToGround) {
GroundtoWalk = Ground + addToGround;
void setGroundToWalk(int GrToWalk) {
GroundtoWalk = GrToWalk;
public void init() {
System.out.println("Init 1"); // This was placed here when i was checking how far it got when debuging
CalcGraphics();
System.out.println("Init 2");
drawGras(1);
System.out.println("Init 3");
repaint();
System.out.println("Init 4");
Image getLevelImage() {
return ImgLevel;
public void paint(Graphics g) {
g.drawImage(ImgLevel,0,0,this);
public void update(Graphics g) {
paint(g);
void drawGras(int pt) {
GrLevel.setColor(BgColor);
GrLevel.fillRect(0,0,800,600);
switch(pt) {
case 1:
GrLevel.setColor(gras1);
GrLevel.fillRect(0,GroundtoWalk,800,300);
GrLevel.setClip(0,GroundtoWalk,800,300);
for(int i = 0; 890>i;i=i+5) {
GrLevel.setColor(gras2);
GrLevel.drawLine(0+i,GroundtoWalk,-190+i,GroundtoWalk+300);
for(int i=950; 0<i; i=i-5) {
GrLevel.setColor(gras3);
GrLevel.drawLine(890-i,GroundtoWalk,1000-i,GroundtoWalk+300);
break;
case 2:
GrLevel.setColor(gras2);
GrLevel.fillRect(0,GroundtoWalk+5,800,300);
for(int i = 0; 890>i;i=i+5) {
GrLevel.setColor(gras3);
GrLevel.drawLine(0+i,GroundtoWalk,-190+i,GroundtoWalk+300);
for(int i=950; 0<i; i=i-5) {
GrLevel.setColor(gras1);
GrLevel.drawLine(890-i,GroundtoWalk,1000-i,GroundtoWalk+300);
break;
case 3:
GrLevel.setColor(gras3);
GrLevel.fillRect(0,GroundtoWalk+10,800,300);
for(int i = 0; 800>i; i=i+20) {
GrLevel.fillArc(0+i,GroundtoWalk,20,20,180,-180);
break;
pattern = pt;
int getGrasPattern() {
return pattern;
void drawSky(int cl) {
GrLevel.setColor(BgColor);
GrLevel.fillRect(0,0,800,155);
switch(cl) {
case 1:
for(int y = 0;y<7;y++) {
for(int x = 0;x<800;x=x+20) {
GrLevel.setColor(Color.white);
GrLevel.drawArc(x,y*20,20,20,180,180);
GrLevel.setColor(Color.red);
GrLevel.drawArc(x,y*20+4,20,20,180,180);
GrLevel.setColor(Color.yellow);
GrLevel.drawArc(x,y*20+2,20,20,180,180);
GrLevel.setColor(Color.green);
GrLevel.drawArc(x,y*20+8,20,20,180,180);
GrLevel.setColor(Color.blue);
GrLevel.drawArc(x,y*20+12,20,20,180,180);
GrLevel.setColor(Color.pink);
GrLevel.drawArc(x,y*20+16,20,20,180,180);
break;
case 2:
GrLevel.setColor(Color.gray);
break;
sky = cl;
GrLevel.setFont(BigText);
GrLevel.setColor(Color.black);
GrLevel.fillRect(0,0,800,50);
GrLevel.setColor(Color.white);
GrLevel.drawString("Score Tabel - comming someday",((size().width)/2)-260, 40);
int getSkyTyp() {
return sky;
}I tested running the code of class Level by puting it into Level.java and compiled it...ran it with appletviewer and it worked as it was intended to.
But when i compiled it with MainGame... and in the HTML started MainGame.class,.....applet didn't intializeand i got the following error messege:
Init 1
java.lang.NullPointerException
at Level.CalcGraphics(MainGame.java:84)
at MainGame.<init>(MainGame.java:11)Line 82: void CalcGraphics() {
Line 83: ImgLevel = createImage(800,600);
Line 84: GrLevel = ImgLevel.getGraphics(); // The First awt.Graphics object
Line 85: }
Line 9: public MainGame() {
Line 10: Level nr1 = new Level();
Line 11: nr1.CalcGraphics(); // calling the method above -> same error first awt.Graphics Object.
If i change it os that "drawGras" comes first it's first awt.Graphics Line will show the same error
Hope some one can and will help meAs per the documentation of
java.awt.Component.createImage(int,int):
Creates an off-screen drawable image to be used for
double buffering.
Parameters:
width - the specified width
height - the specified height
Returns:
an off-screen drawable image, which can be used for
double buffering. The return value may be null if the
component is not displayable. This will always happen
if GraphicsEnvironment.isHeadless() returns true.
Since:
JDK1.0 its not
ImgLevel = createImage(800,600); that's making the problem but The first awt.Graphics Object in class Level, no mather which on it is =((
>
The key part is '...may be null if the component is
not displayable.'
You should put your graphics initialization code in
start(), which will be called when your applet is
ready to go. Before then, your applet is not
displayable. (Also, remember to dispose() your
graphics in your stop() method, if not sooner.)for the part writen above...I'll try to change it like you are saying.
Thanx for your help! -
Trying to move a graphics object using buttons.
Hello, im fairly new to GUI's. Anyway I have 1 class which makes my main JFrame, then I have another 2 classes, one to draw a lil square graphics component (which iwanna move around) which is placed in the center of my main frame and then another class to draw a Buttonpanel with my buttons on which is placed at the bottom of my main frame.
I have then made an event handling class which implements ActionListner, I am confused at how I can get the graphics object moving, and where I need to place the updateGUI() method which the actionPerformed method calls from inside the event handling class.
I am aware you can repaint() graphics and assume this would be used, does anyone have a good example of something simular being done or could post any help or code to aid me, thanks!Yeah.. here's an example of custom painting on a JPanel with a box. I used a mouse as it was easier for me to setup than a nice button panel on the side.
Anyways... it should make it pretty clear how to get everything setup, just add a button panel on the side. and use it to move the box instead of the mouse.
-Js
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.MouseEvent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.event.MouseInputAdapter;
public class MoveBoxAroundExample extends JFrame
private final static int SQUARE_EDGE_LENGTH = 40;
private JPanel panel;
private int xPos;
private int yPos;
public MoveBoxAroundExample()
this.setSize(500,500);
this.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
this.setContentPane(getPanel());
xPos = 250;
yPos = 250;
this.setVisible(true);
private JPanel getPanel()
if(panel == null)
panel = new JPanel()
public void paintComponent(Graphics g)
super.paintComponent(g);
g.setColor(Color.RED);
g.fillRect(xPos-(SQUARE_EDGE_LENGTH/2), yPos-(SQUARE_EDGE_LENGTH/2), SQUARE_EDGE_LENGTH, SQUARE_EDGE_LENGTH);
MouseInputAdapter mia = new MouseInputAdapter()
public void mousePressed(MouseEvent e)
xPos = e.getX();
yPos = e.getY();
panel.repaint();
public void mouseDragged(MouseEvent e)
xPos = e.getX();
yPos = e.getY();
panel.repaint();
panel.addMouseListener(mia);
panel.addMouseMotionListener(mia);
return panel;
public static void main(String args[])
new MoveBoxAroundExample();
} -
Best way to draw thousands of graphic objects on the screen
Hello everybody, I'm wanting to develop a game where at times thousands of graphic objects are displayed on-screen. What better way to do this in terms of performance and speed?
I have some options below. Do not know if the best way is included in these options.
1 - Each graphical object is displayed on a MovieClip or Sprite.
2 - There is a Bitmap that represents the game screen. All graphical objects that are displayed on screen have your images stored in BitmapData. Then the Bitmap that represents the game screen copies for themselves the BitmapData of graphical objects to be screened, using for this bitmapData.copyPixels (...) or BitmapData.draw (...). The Bitmap that represents the screen is added to the stage via addChild (...).
3 - The graphical objects that are displayed on screen will have their images drawn directly on stage or in a MovieClip/Sprite added to this stage by addChild (...). These objects are drawn using the methods of the Graphics class, as beginBitmapFill and beginFill.
Recalling that the best way probably is not one of these 3 above.
I really need this information to proceed with the creation of my game.
Please do not be bothered with my English because I'm using Google translator.
Thank you in advance any help.Thanks for the information kglad. =)
Yes, my game will have many objects similar in appearance.
Some other objects will use the same image stored, just in time to render these objects is that some effects (such as changing the colors) will be applied in different ways. But the picture for them all is the same.
Using the second option, ie, BitmapDatas, which of these two methods would be more efficient? copyPixels or draw?
Thank you in advance any help. =D
Maybe you are looking for
-
Deleted Po's not in search results POWL
Hi All, I have a question,.. We are on SRM 7.02 and when I want to search for PO's which are deleted (status deleted) in POWL I don't get any search results. Is it a standard behaviour deleted PO's don't show up in search results? The deleted PO's I
-
E-Recruiting: Business partner - Telephone
Hi All, When ever I create a user in E-Recruiting, by default a BP will be generated. If we go to BP transaction, in Address independent data - telephone number is empty. So how to update the telephone number in BP? Please share your ideas. Thanks,
-
I have 3 hierarchical tables. [Parent] ->[Child1]->[Child2] I have [Xref] table which stores the documents associated with these three tables. In the [Xref] table, the column "TypeID" defines to which table the document is associated with. Below is t
-
So a few months back, word would not allow me to open previously save documents that I had once saved. The problem grew to not even being able to open word at all. I have not had any changes to my computer nor any problems prior. I did the step by st
-
Are there any plans to add rowing machine data to health app
The health app is definitely good if your a runner or cyclist, however it doesn't seem to cover logging gym workout data. Does Apple have any plans to add metrics to the health app for these. In particular I use a rowing machine and it would be great