Simple image editor applet
Hello!
I am looking for an applet that can edit images in a simple way. I mean, add a background, add text, add some other image...but very easy to use.
I also need the images to let me change the text once they have saved and reopened in the applet (like in powerpoint).
Do any of you know where I can find some similar applet that I can modify or reuse?
thank you in advance for you help!
You can find one here izhuk.com but this is a commercial solution.
Similar Messages
-
I want to make a simple image editor by as
I do not have any concept about how to scale the image in the
editor.
For example, when the user clicked one of the image in the
editor then he/she can scale the selected image by mouse just like
the scale function in MS Paint..
thank so much~You can definitely use the technique I mentioned to order the columns to make it easy to chart:
Here I created a table (the top one) to hold the original data and make a second table (the lower one) to pull data into two adjacent columns:
The bottom table, as I said pulls data from the top data table:
Then highlight the data in the table to chart, and selec the chart type from the menu (I suggest the bar chart which is the first item in the chart tool menu):
I made up this data and mean it to be no reflection on your running ability -
I enjoy iPhoto, but is there a simple image editor / creator for Mac?
I am a new Mac user and run a virtual machine on top of the Mac OS with VM Fusion (running windows 7). I first installed the virtual machine when I bought my computer, to use some software for work. The software issues I had when I bought my Mac are now gone, but I find myself using the Windows side of things for Paint. I have PhotoShop on my MacBook Pro, which works well when I want to do a lot of work on photos, but to create images and edit images I find the program kind of bulky.
I was wondering if anyone has a recommendation for a program that is Paint for Mac (or close...)...but I find myself using the Windows side of things for Paint...
Preview, included with OSX, has some simple tools for creating lines and text. I use it when I need to blank out personal info from screenshots when submitting bug reports or posting to the forums here.
If you really want something close to Paint, you can download Paintbrush. Maybe my needs were simple, but any editing I did with Windows' Paint, I found I could do with Preview, so I hardly ever have to open Paintbrush.
...I have PhotoShop on my MacBook Pro, which works well when I want to do a lot of work on photos, but to create images and edit images I find the program kind of bulky....
Not to be snarky, but I can't really imagine what kind of "editing" of a photo you'd be doing in Paint. As I mentioned above, Preview does similar to Paint to create lines, boxes, text and such, but nothing that I'd consider "photo editing." You said you like iPhoto. I found that many of the "touchup" tasks I used Photoshop for I can do in iPhoto, and iPhoto is quite simple to use compared to Photoshop. Once I really started using iPhoto as the primary means to import from my camera, which naturally leads to having iPhoto organize and manage your photo library, using iPhoto for editing became quite natural. -
Looking for Image Button Applet
I'm looking for a simple image button applet (normal state, mouse-over and mouse-click) which can refer to a HTML or start a Javascript function. Can anyone help?
KippieHi,
This is the source code. I don't quite understand what I should do with the tokens. I hope this is allright. Thanks for your help
Kippie.
import java.net.URL;
import java.awt.Color;
import java.util.Vector;
import java.util.Enumeration;
import java.util.StringTokenizer;
import java.applet.Applet;
import java.applet.AudioClip;
Program Name: ImageURLButtonBar
Author: Paul Whitelock
Version: 1.1
Copyright: (c) 1997 by Paul Whitelock and Modern Minds, Inc.
Requires: ImageURLButtonBar.class
ButtonBar.class
ButtonBarObserver.class (Interface definition)
ButtonRegion.class
ButtonAnimate.class
Modifications: v1.01 (15 April 97)
* Added "sticky" button behavior (controlled
by applet "stick" parameter)
v1.03 (25 June 97)
* Added applet parameter "useCodeBase". If useCodeBase
is true, then image file locations will be based on the directory
in which the Java class files are located. If useCodeBase is false, then
the locations will be based on the HTML directory. Note that audio
file locations are always based on the Java directory. The default
for useCodeBase is false (use HTML directory for base).
* The "stick" parameter will now accept a button number in
addition to the value of "true" or "false". If a button number
is specified, then that button will be "stuck" down
when the button bar initializes.
* Added the capability of loading multiple URLs for each button
with an optional target for each URL.
v1.1 (25 September 97)
* Added "baseBrighten" and "baseBrightenTint" parameters to control
highlighting for base button bar.
* Added "mouseOverBrighten" and "moBrightenTint" parameters to control
highlighting for base button bar.
* Added "mdBrightenTint" and "mdBrightenAll" parameters to control
highlighting for base button bar. Previous versions of the applet
supported "mouseDownBrighten," but only if button borders were not
drawn for the button-down button bar (the "mdBrightenAll" can be set
to "true" to override the this default behavior).
* An "appletBGColor" parameter has been added to set the
applet background color. The applet background color is
sometimes visible during scrolling or during a page repaint.
NOTE: This source code was composed using Microsoft Visual J++
with tab stops of 4. Text may not be formatted correctly
if another editor is used.
******************************** PARAMETERS ********************************
Applet Parm ButtonBar Class Parm Default Value
================== ======================= ==================
appletBGColor
disableBadURL true
mouseEnterAudio null (audio disabled)
mouseClickAudio null (audio disabled)
buttonDownAudio null (audio disabled)
stick false
* useCodeBase base false (i.e., use getDocumentBase())
orient barHorizontal horizontal if applet width > height
base baseBarName none - parameter REQUIRED
mouseOver mouseOverBarName null
mouseOver2 mouseOverBar2Name null
mouseDown mouseDownBarName null
mouseDownOver mouseDownOverBarName null
buttonsDisabled buttonsDisabledBarName null
background backgroundImageName null
barXPos barXBackgroundPos 0
barYPos barYBackgroundPos 0
buttonBorders drawButtonBorders ButtonBar.BORDERS_NONE
borderColorTL borderColorTopLeft null (Color.white if error)
borderColorBR borderColorBottomRight null (Color.gray if error)
borderIntensity borderIntensityPercent 50 (used only if borders)
borderSize buttonBorderSize 1 (used only if borders)
downShift downShift false
downShiftAmt downShiftAmt buttonBorderSize
baseBrighten baseBrightenPct
baseBrightenTint baseBrightenTint
mouseOverBrighten mouseOverBrightenPct
moBrightenTint mouseOverBrightenTint
mouseDownBrighten mouseDownBrightenPct
mdBrightenTint mouseDownBrightenTint
mdBrightenAll mouseDownBrightenAll
buttonsDisabledDim buttonsDisabledDimPct 25 (used only if no buttonsDisabled)
grayBarBrighten grayBarBrighten 0
frameRate frameRate 150 (used only if mouseOver2)
* If useCodeBase is true, then all file locations are based on the Java class file
directory (i.e., use getCodeBase()).
public class ImageURLButtonBar extends Applet implements ButtonBarObserver {
// Instance Variables
ButtonBar buttonBar;
Vector buttonURL = new Vector(10, 10);
Vector buttonURLTarget = new Vector(10, 10);
Vector buttonDescription = new Vector(10, 10);
AudioClip mouseEnterAudio = null;
AudioClip mouseClickAudio = null;
AudioClip buttonDownAudio = null;
// Applet Initialization
public void init() {
// =================================================================
// Applet ImageURLButtonBar specific parameters
// =================================================================
// appletBGColor
// Set applet background color
String parm = getParameter("appletBGColor");
if (parm != null) {
try {
setBackground(new Color(Integer.parseInt(parm, 16)));
catch (Exception e) {
reportError("appletBGColor");
// disableBadURL
// If true, then any button with an invalid URL will be disabled
parm = getParameter("disableBadURL");
boolean disableBadURL;
if (parm == null || !parm.equals("false")) disableBadURL = true;
else disableBadURL = false;
// mouseEnterAudio
// Sound to play each time the mouse enters any of the buttons
parm = getParameter("mouseEnterAudio");
if (parm != null) {
mouseEnterAudio = getAudioClip(getCodeBase(), parm);
if (mouseEnterAudio == null) reportError("Can't load " + parm);
// mouseClickAudio
// Sound to play each time a mouse down click occurs in a button
parm = getParameter("mouseClickAudio");
if (parm != null) {
mouseClickAudio = getAudioClip(getCodeBase(), parm);
if (mouseClickAudio == null) reportError("Can't load " + parm);
// buttonDownAudio
// Sound to play each time a mouse up occurs in a button (i.e, the
// button has be toggled through it's "down" position)
parm = getParameter("buttonDownAudio");
if (parm != null) {
buttonDownAudio = getAudioClip(getCodeBase(), parm);
if (buttonDownAudio == null) reportError("Can't load " + parm);
// stickyBar
// If the "stick" applet parameter is "true", then buttons will stay
// "stuck" in the down position until another button is clicked.
// If the "stick" applet parameter is the number of a button in the
// button bar, then that button will be "stuck" down when the
// button bar initializes.
int stickyBar = -1;
parm = getParameter("stick");
if (parm != null && !parm.toLowerCase().equals("false")) {
try {
stickyBar = Integer.parseInt(parm);
catch (Exception e) {
stickyBar = 0;
// =================================================================
// Class ButtonBar specific parameters
// =================================================================
// orient (barHorizontal)
// If this parameter = 'h' then the button bar is horizontal
// If this parameter = 'v' then the button bar is vertical
// If this parameter is not specified, then the button bar is
// horizontal if the applet width is greater than the applet height
boolean horizontal;
parm = getParameter("orient");
if (parm == null) horizontal = size().width > size().height;
else horizontal = parm.equals("h") ? true : false;
// base (baseBarName)
// The base image file for the buttons. This is the only image
// file that MUST be specified.
String baseBar = getParameter("base");
if (baseBar == null) {
reportError("Parameter 'base' REQUIRED!");
return;
// barXPos (barXBackgroundPos)
// barYPos (barYBackgroundPos)
// If a background image is specified then these to parameters
// represent the top-left corner location where the button bar
// should be placed on the background
int barXPos = 0, barYPos = 0;
try {
parm = getParameter("barXPos");
if (parm != null) barXPos = Integer.parseInt(parm);
parm = getParameter("barYPos");
if (parm != null) barYPos = Integer.parseInt(parm);
catch (Exception e) {
reportError("barXPos or barYPos");
barXPos = barYPos = 0;
// buttonBorders (drawButtonBorders)
// "none" = do not draw any button borders
// "all" = draw borders around all button bar buttons
// "base" = draw borders only around buttons on base button bar
// "other" = draw borders around all button bar buttons EXCEPT base button bar buttons
parm = getParameter("buttonBorders");
int drawButtonBorders = ButtonBar.BORDERS_NONE;
if (parm != null) {
if (parm.equals("base")) drawButtonBorders = ButtonBar.BORDERS_BASE;
else if (parm.equals("other")) drawButtonBorders = ButtonBar.BORDERS_OTHER;
else if (parm.equals("all")) drawButtonBorders = ButtonBar.BORDERS_ALL;
// borderColorTL (borderColorTopLeft)
// borderColorBR (borderColorBottomRight)
// Normally, borders are drawn around buttons by lightening or darkening
// the image in the border region. A specific color can be used instead
// for the top and left borders and/or the bottom and right borders. The
// value specified for either of these two parameters should be a hexadecimal
// number (e.g., "FF0000" for red, "888888" for medium gray, etc.).
Color borderColorTopLeft = null;
Color borderColorBottomRight = null;
try {
parm = getParameter("borderColorTL");
if (parm != null) borderColorTopLeft = new Color(Integer.parseInt(parm, 16));
parm = getParameter("borderColorBR");
if (parm != null) borderColorBottomRight = new Color(Integer.parseInt(parm, 16));
catch (Exception e) {
reportError("borderColorTL or borderColorBR");
borderColorTopLeft = Color.white;
borderColorBottomRight = Color.gray;
// borderIntensity (borderIntensityPercent)
// If borders are drawn for buttons, and if a border color is not specified
// (see above), then the image in the border region will be lightened or
// darkened by this percentage to create the borders.
int borderIntensityPercent = 50;
try {
parm = getParameter("borderIntensity");
if (parm != null) borderIntensityPercent = Integer.parseInt(parm);
catch (Exception e) {
reportError("borderIntensity");
borderIntensityPercent = 50;
// borderSize (buttonBorderSize)
// The size of borders, if borders are specified.
int buttonBorderSize = 1;
try {
parm = getParameter("borderSize");
if (parm != null) buttonBorderSize = Integer.parseInt(parm);
catch (Exception e) {
reportError("borderSize");
// downShift
// If true, then the button image is shift down and right downShiftAmt
// (see below) pixels when the mouse is clicked on the button.
parm = getParameter("downShift");
boolean downShift = (parm == null || !parm.equals("true")) ? false : true;
// downShiftAmt
// If downShift is true, then the button image is shift down and right
// downShiftAmt (see above) pixels when the mouse is clicked on the button.
int downShiftAmt = buttonBorderSize;
try {
parm = getParameter("downShiftAmt");
if (parm != null) downShiftAmt = Integer.parseInt(parm);
catch (Exception e) {
reportError("downShiftAmt");
// baseBrighten (baseBrightenPct)
// The base bar will be lightened by this percentage
int baseBrightenPct = 0;
try {
parm = getParameter("baseBrighten");
if (parm != null) baseBrightenPct = Integer.parseInt(parm);
catch (Exception e) {
reportError("baseBrighten");
// mouseOverBrighten (mouseOverBrightenPct)
// A button will be lightened by this percentage when the mouse
// moves over a button.
int mouseOverBrightenPct = 0;
try {
parm = getParameter("mouseOverBrighten");
if (parm != null) mouseOverBrightenPct = Integer.parseInt(parm);
catch (Exception e) {
reportError("mouseOverBrighten");
// mdBrightenAll (mouseDownBrightenAll)
// A button will be lightened by this percentage when the mouse
// moves over a button.
boolean mouseDownBrightenAll = false;
parm = getParameter("mdBrightenAll");
if (parm != null && parm.charAt(0) == 't') mouseDownBrightenAll = true;
// mouseDownBrighten (mouseDownBrightenPct)
// A button will be lightened by this percentage when it is
// clicked.
int mouseDownBrightenPct = 0;
try {
parm = getParameter("mouseDownBrighten");
if (parm != null) mouseDownBrightenPct = Integer.parseInt(parm);
catch (Exception e) {
reportError("mouseDownBrighten");
// baseBrightenTint (mouseOverBrightenTint)
// moBrightenTint (mouseOverBrightenTint)
// mdBrightenTint (mouseDownBrightenTint)
Color baseBrightenTint = null;
Color mouseOverBrightenTint = null;
Color mouseDownBrightenTint = null;
try {
parm = getParameter("baseBrightenTint");
if (parm != null) baseBrightenTint = new Color(Integer.parseInt(parm, 16));
parm = getParameter("moBrightenTint");
if (parm != null) mouseOverBrightenTint = new Color(Integer.parseInt(parm, 16));
parm = getParameter("mdBrightenTint");
if (parm != null) mouseDownBrightenTint = new Color(Integer.parseInt(parm, 16));
catch (Exception e) {
reportError("baseBrightenTint, moBrightenTint or mdBrightenTint");
// buttonsDisabledDim (buttonsDisabledDimPct)
// If a button is disabled and if there is no buttonsDisabled image,
// then the button will be dimmed by this percentage.
int buttonsDisabledDimPct = 25;
try {
parm = getParameter("buttonsDisabledDim");
if (parm != null) buttonsDisabledDimPct = Integer.parseInt(parm);
catch (Exception e) {
reportError("buttonsDisabledDim");
// grayBarBrighten
// If there is no mouseOver image, then the base image will be used for
// the mouseOver image, and a grayscale version of the base image will
// be used for base button images. This parameter can be used to lighten
// COLORS (not grays) in the image before it is converted to grayscale.
// This can help if the standard conversion produces buttons that are
// too dark.
int grayBarBrighten = 0;
try {
parm = getParameter("grayBarBrighten");
if (parm != null) grayBarBrighten = Integer.parseInt(parm);
catch (Exception e) {
reportError("grayBarBrighten");
// frameRate
// If a mouseOver2 image is specified, then this parameter controls
// how quickly animation will be performed (using mouseOver and mouseOver2
// images) in milliseconds when the mouse is moved over a button.
int frameRate = 150;
try {
parm = getParameter("frameRate");
if (parm != null) frameRate = Integer.parseInt(parm);
catch (Exception e) {
reportError("frameRate");
// =================================================================
// Instantiate the button bar
// =================================================================
try {
// Allow the use of documentBase (default) or codeBase for image file
// base directory.
URL documentBase;
parm = getParameter("useCodeBase");
if (parm == null || parm.equals("false")) documentBase = getDocumentBase();
else documentBase = getCodeBase();
// Create the button bar
buttonBar = new ButtonBar(
horizontal, /* barHorizontal */
documentBase, /* base */
baseBar, /* baseBarName */
getParameter("mouseOver"), /* mouseOverBarName */
getParameter("mouseOver2"), /* mouseOverBar2Name */
getParameter("mouseDown"), /* mouseDownBarName */
getParameter("mouseDownOver"), /* mouseDownOverBarName */
getParameter("buttonsDisabled"),/* buttonsDisabledBarName */
getParameter("background"), /* backgroundImageName */
barXPos, /* barXBackgroundPos */
barYPos, /* barYBackgroundPos */
drawButtonBorders, /* drawButtonBorders */
borderColorTopLeft, /* borderColorTopLeft */
borderColorBottomRight, /* borderColorBottomRight */
borderIntensityPercent, /* borderIntensityPercent */
buttonBorderSize, /* buttonBorderSize */
downShift, /* downShift */
downShiftAmt, /* downShiftAmt */
baseBrightenPct, /* baseBrightenPct */
baseBrightenTint, /* baseBrightenTint */
mouseOverBrightenPct, /* mouseOverBrightenPct */
mouseOverBrightenTint, /* mouseOverBrightenTint */
mouseDownBrightenAll, /* mouseDownBrightenAll */
mouseDownBrightenPct, /* mouseDownBrightenPct */
mouseDownBrightenTint, /* mouseDownBrightenTint */
buttonsDisabledDimPct, /* buttonsDisabledDimPct */
grayBarBrighten, /* grayBarBrighten */
frameRate /* frameRate */
// =================================================================
// Add buttons to the button bar
// =================================================================
ButtonRegion buttonToAdd;
String buttonNbr, urlString;
URL urlForButton;
int nbr = 0;
int buttonStart, buttonSize;
// Initialize button on bar flag (used to determine if at least one button
// was successfully added to the button bar)
boolean buttonOnBar = false;
// This loop will be exited when no more buttons can be found in the HTML
while (true) {
// Construct the prefix for the button parameters
buttonNbr = "button" + ++nbr;
// Find the starting offset and the size of the button
// If null is returned as the starting offset parameter value for the
// button, then all buttons should have been read so the loop can
// be exited.
try {
parm = getParameter(buttonNbr + "Start");
if (parm == null) break;
buttonStart = Integer.parseInt(parm);
buttonSize = Integer.parseInt(getParameter(buttonNbr + "Size"));
catch (Exception e) {
reportError("Button" + nbr + " start or size in error or missing");
buttonStart = 0;
buttonSize = 0;
// Create a ButtonRegion for the button
// The button ID will be set to the number of the button (this will
// be converted to an integer later when a buttonBarEvent is received).
buttonToAdd = new ButtonRegion("" + nbr, buttonStart, buttonSize);
// If the buttons on this button bar are "sticky" buttons, then
// enable "sticky" behavior for this button. The button will always
// "pop-up" whenever another button is clicked.
if (stickyBar >= 0) {
buttonToAdd.stickyButton(true, ButtonRegion.POPUP_ALWAYS, false);
// If the current button number matches the value of stickyBar, then the
// current button should be "stuck" down for its initial state.
if (stickyBar == nbr) buttonToAdd.setStuck(true);
// Try to add the button (i.e., the ButtonRegion) to the buttonBar
if (buttonBar.addButton(buttonToAdd)) {
// Set flag to indicate that at least one button has been added
buttonOnBar = true;
// The button was successfully added, so save the button's description
// (which will be displayed in the status bar) and the target frame
// for the button URL in the appropriate Vector.
buttonDescription.addElement(getParameter(buttonNbr + "Desc"));
buttonURLTarget.addElement(getParameter(buttonNbr + "Target"));
// Try to create a URL for the button.
// If the URL is invalid, then place an error message in the
// buttonURLTarget Vector (this will be used to warn the user
// when the button is clicked). Also, if disableBadURL is true, then
// disable the button.
String theURL;
urlString = getParameter(buttonNbr + "URL");
if (urlString != null) {
Enumeration urls = new StringTokenizer(urlString);
while (urls.hasMoreElements()) {
theURL = (String)urls.nextElement();
try {
urlForButton = new URL(theURL);
catch (Exception e) {
try {
urlForButton = new URL(getDocumentBase(), theURL);
catch (Exception e2) {
reportError("Button" + nbr + " has invalid URL");
buttonURLTarget.setElementAt("Invalid URL", nbr - 1);
urlString = null;
break;
else {
reportError("Button" + nbr + " has no URL");
buttonURLTarget.setElementAt("No URL", nbr - 1);
buttonURL.addElement(urlString);
// Remove any unused elements in the Vectors
buttonURL.trimToSize();
buttonURLTarget.trimToSize();
buttonDescription.trimToSize();
// If no buttons were added, throw exception
if (!buttonOnBar) throw new IllegalArgumentException("No buttons on bar");
// Let the buttonBar know that all buttons have been defined. This is
// really only necessary if downShift is true, but it won't hurt calling
// the method in either case.
buttonBar.allButtonsDefined();
// Add the applet as an observer so that the applet will be notified
// when button events occur.
buttonBar.addButtonObserver(this);
// Enable the button bar now that all buttons have been defined.
// (the buttonBar is disabled when it is created and must be
// specifically enabled).
buttonBar.enable(true);
// Add the buttonBar to the applet
setLayout(null);
add(buttonBar);
catch (Exception e) {
reportError("Can't create ButtonBar\n" + e);
// buttonBarEvent
// This method is called by the ButtonBar whenever a button event occurs
// It provides the ButtonBar that the event occurred for, the button ID
// that the event occurred for, and the event type.
public void buttonBarEvent(ButtonBar barID, String buttonID, int buttonEvent) {
String description;
// The buttonBar will send an IMAGES_READY event when all button bar images
// have been prepared. We are not interested in this event, but only in
// certain "action" events that occur for a button.
if (buttonEvent != ButtonBar.IMAGES_READY) {
// A number in String format was assigned as the buttonID when each
// ButtonRegion was created. The buttonID String will now be converted
// back into a number that can be used as a Vector index to retrieve
// button specific information (i.e., URL, target frame, and description).
int buttonNbr = Integer.parseInt(buttonID) - 1;
switch (buttonEvent) {
// If a mouseDown event has occurred for the button, and if an
// AudioClip is available for this event, play the AudioClip.
case ButtonBar.MOUSE_CLICK:
if (mouseClickAudio != null) mouseClickAudio.play();
break;
// If the mouse has been moved over a button, display the button's
// description in the browser's status area. If the button that the mouse
// is over is an active button, and if there is an AudioClip available
// for this event, then play the audio clip.
case ButtonBar.MOUSE_ENTER:
case ButtonBar.MOUSE_ENTER_DISABLED:
description = (String)buttonDescription.elementAt(buttonNbr);
if (description != null) showStatus(description);
if (mouseEnterAudio != null && buttonEvent == ButtonBar.MOUSE_ENTER) {
mouseEnterAudio.play();
break;
// If the mouse has been moved off of a button and if the button has
// description text associated with it, then clear the browser's
// browser's status area.
case ButtonBar.MOUSE_EXIT:
case ButtonBar.MOUSE_EXIT_DISABLED:
description = (String)buttonDescription.elementAt(buttonNbr);
if (description != null) showStatus("");
break;
// If the button has been depressed (i.e., a mouseDown followed by
// a mouseUp for the same button) then load the URL(s) for the button
// in the target frame(s), if specified. If the URL is null, then the
// URL was found to be missing or invalid, so display the text stored in
// the buttonURLTarget Vector in the brower's status area. If there is
// an AudioClip for the event, play the audio.
case ButtonBar.BUTTON_DOWN:
// Get the string of URLs and Targets for the button
String urlString = (String)buttonURL.elementAt(buttonNbr);
String targetString = (String)buttonURLTarget.elementAt(buttonNbr);
// If there is at least one URL for the button
if (urlString != null) {
URL urlForButton;
String theURL;
String theTarget;
Enumeration urls = new StringTokenizer(urlString);
Enumeration targets = null;
if (targetString != null) targets = new StringTokenizer(targetString);
// While there is another URL for the button
while (urls.hasMoreElements()) {
// Get the next String token that represents a URL
theURL = (String)urls.nextElement();
// Convert the String to a URL
try {
urlForButton = new URL(theURL);
catch (Exception e) {
try {
urlForButton = new URL(getDocumentBase(), theURL);
catch (Exception e2) {
urlForButton = null;
break;
// If the String was successfully convert to a URL
if (urlForButton != null) {
// If there is a target for this URL
if (targets != null && targets.hasMoreElements()) {
// Get the String that represents the target
theTarget = (String)targets.nextElement();
// If the target String does NOT begin with a "-",
// then load the URL in the target
if (theTarget.charAt(0) != '-') {
getAppletContext().showDocument(urlForButton, theTarget);
// Else a target for this URL should not be used
else {
getAppletContext().showDocument(urlForButton);
// Else there is no target for this URL, so just show
// the URL.
else {
getAppletContext().showDocument(urlForButton);
// Else URL is missing or invalid
else showStatus((String)buttonURLTarget.elementAt(buttonNbr));
if (buttonDownAudio != null) buttonDownAudio.play();
break;
// Error reporting
private void reportError(String message) {
message = "[ImageURLButtonBar] Error - " + message;
System.out.println(message);
showStatus(message);
} -
What's the best freeware image editor for Mac OS X 10.5.5?
Hi.
I noticed Mac OS X 10.5.5 doesn't come with an image editor (mainly for photographs) like Microsoft Windows' simple MS Paint (and free Irfanview to download and use). Are there similiar ones for Mac OS X? I was going to get Paint.net, but it has no Mac support. Gimp is nice but too complex and bloated. And yes, I did a Google search but got too many hits.
Thank you in advance.Takes about 9 seconds till it's ready to do from the moment I click the dock icon, but from that point onwards it's as fast as anything else I've used.
I love both the app and the price.
Hmm, I will try again. Which native Mac OS X port do you recommend? I see a bunch now compared what I saw one in the past.
You can download the source and compile, but there are also Leopard binaries available for slightly less new versions.
Actually 2.6.1 has just been released
http://www.gimp.org/
but the most recent binary for OS-X is here
http://darwingimp.sourceforge.net/
Mine runs with the version of X11 that comes with Leopard.
And BTW, the latest version of fink for Leopard is great. Much better interface and much easier to install, update and maintain.
Thanks. I am surprised there are no native ports still. -
Hello,
I am receiving a lot of emails with pictures attached. So I have set a program to view these files very fast (similar to Windows Fax/Image viewer). When I want to edit an Image within CS4 and click on "edit with external editor" the 'default' program above mentioned comes up instead of Photoshop. I know there"s a drop down menu and I can chose to open with Photoshop instead.
My simple question: can I tell CS4 that only Photoshop is the default image editor when I work within Indesign?
Thanks
MattPeter's right, but "image" covers a wide variety of different kinds of
files. I have .jpg set to open by default in the Windows Image viewer,
but .psd and .tif are set to open in Photoshop. I have .eps set to open
in a text editor, because I get eps files from all over the place, and
if I view it with a text editor I can usually figure out whether the eps
file came from Illustrator, or Photoshop, or some other source.
What I've never figured out about extensions is how to change the file
association for files that have no extension at all. I get a lot of Mac
files, many without extensions, and for some reason the default program
associated with extensionless files is Winamp.
Kenneth Benson
Pegasus Type, Inc.
www.pegtype.com -
Problem with display of images in applets
Hi all,
When I run this program, the appletviewer window is showing no output (i.e. no image). I'm using the netbeans IDE 5.0.
Blue hills.jpg is present in both the src folder and build folder.
* <applet code="image" width =800 height=600>
* <param name="img" value="Blue hills.jpg">
* <\applet>
import java.awt.*;
import java.applet.*;
public class image extends Applet {
Image img;
public void init() {
img=getImage(getDocumentBase(), getParameter("img"));
public void paint(Graphics g){
g.drawImage(img,0,0,this);
Please help in figuring out the problem....It will be looking for it in the folder with the HTML that invokes the applet.
If you want to pack the image in with the applet then use getResource instead.
And spaces in the name are probably not the best idea. -
Multiple image upload CRASH!!! but works with simple image upload
I'm getting MAD.
I'm using php and GD
While the simple image and re size works like a charm, the multiple image upload or the multiple file upload have a strange behavior.
It opens the pop-up with flash, then eventually shows me files or thumbnails but when I try to up load I just wait and get the typical "system becoming unstable" flash error.
As I can see the directory is always generated (I've tried also to put a static directory) but after stargin the upload the flash uploader just crashes and no result.
Any help would be really appreciatedHi Fonzie,
as the folder is getting created, the issue you´re having is not related to wrong folder permission - it´s something else...
As I wrote before, che common upload and resize function works perfectly
this one works perfectly, because it´s just one file to upload and to process, wheras doing that with multiple files might collide with some settings on your server
So for sure it's not a simple issue as the max filesize
Are you sure ? Did you check the current "max_upload_filesize" setting ? As long you don´t check it, you can´t know :-)
As a general rule of thumb, it´s important to be aware of the fact that uploading & resizing images on the server might collide with several PHP settings -- and the more images you upload and resize in one swoop, the closer you´re getting to these limits respectively might even be exceeding them. The following "directives" are those which have an effect on whether your image/file upload & processing will work or not:
- "max_upload_filesize" :: is sometimes set to just 8 MB on a shared hosting, sometimes 16 MB, sometimes more. This setting will affect the file upload procedure only
- "set_time_limit" (e.g. 30 seconds) :: if the execution time of a script exceeds this limit for whatever reason, the server simply shuts it down without letting you (respectively the flash uploader) know it´s been shut down. This *might* be the reason why ADDT´s flash uploader hangs respectively returns that error message after some time, because it´s waiting for some response from the server which never comes.
- "memory_limit" (e.g. 8 MB) :: this directive is a sort of "allocated server RAM" for your account, and it´s in particular the image resizing process which will grab more or less memory resources -- the higher the the resizing factor is, the more RAM is spent, and the more images are getting resized in one swoop, the worser it gets.
However, all these PHP directives can be changed, and your host might even be so courteous to increase the currently defined values of those abovementioned directives for you -- and that´s what I´m suggesting at this point.
Cheers
Günter Schenk
Adobe Community Expert, Dreamweaver -
How to move multiple images in applet
Hi,how to move multiple images in applet or random images in applet .
Means moving images.gif around the applet with different starting point ,help me to create that move method ..why don't you check the tumbling duke applet as provided free in this site? :-)
-
Why is using Photoshop CS6 as the touchup image editor for Acrobat still a complete failure?
Image objects in pdfs are losing their positional and other parameters when saved after editing with Photoshop CS6(ONLY). The problem was acknowledged on the Photoshop forum three months ago, but they said it was up to the Acrobat folks to fix it. When using most previous versions of Photoshop (CS2-CS5 all tested) as the touchup image editor, Acrobat was able to place the image right back into it's previous position in the pdf and it could do this without releasing whatever path was used to crop or mask the image (basically it worked great). However, using Photoshop CS6 as the touchup image editor is still a complete failure. Any idea when or if this will be fixed?
Thanks
Link to PS forum articleThe Photoshop 13.0.1 Update fixes this issue. Excellent.
-
hi every body.
I want to display images in an applet when i invoke it from the jsp page . it is not working. the code is as follows.
<html>
<body>
<jsp:plugin type = "applet"
code ="Welcome.class"
width="475" height = "350" >
</jsp:plugin>
</body>
</html>
while the code of "Welcome.java" is as follows.
ImageIcon image = new ImageIcon("aa.gif");
JButton button = new JButton(image);
i have placed the aa.gif file in the same directory where i placed the Welcome.class and the jsp file.
when i run this program the i recieve the message that the applet is not loaded.
can some body help me how to place images in applets.
thanks.You should be able to test that applet on you hard drive first. If it works check the case of the image file.
Web servers look for case. If you are asking for ImageIcon img = new ImageIcon("abc.gif") and what is loaded on your web server is "abc.GIF" it won't find it. Same goes for basic HTML tags like
<Img src=abc.gif>. But it will find it on you hard drive when you run the applet there. -
Need to create/buy/Use a Web based Image Editor
Hi all
I'm new here, just got a new project for printing shop, they need to have their users editing Business cards to put their own information.
So there will be a tamplet of cards and user can pick up up and edit it accordingly and save it to the server.
I have looked many places but couldnt find a flash web based editing comp. if you have one or know of one please notify me, or if you can make one.
Here is an example of what I am talking about
http://67.18.244.218/startdemo.asp?tp=3
click on any image to see what we need.
Your help is much appreicated.
Thanks in advancehere is an example, again this is a brower based.
You got a simple image with few layers and simple funcationality to change it, like changing the text, colors, positions .... -
Efficient data structure to implement simple text editor?
I was given this problem in an interview:
What data structure would you use to implement a simple text editor that does these 4 functions:
a) goto(line number)
b) insert(char input,location)
c) delete(location)
d) printAll() //print entire file
Given that i'm such a newb, i was stumped. I came up with making a 2d array that would allow for o(1) time for goto, but o(n) for everything else (shifting everything in the array). there were other downfalls too dealing with space issues and such, but he wanted me to optimize this data structure. I then came up with a linked list of arrays, but that had similar problems.
But thinking about it further is driving me a little crazy so I'm wondering if you guys have any suggestions on how to answer this question...
one thing that came to mind after is to implement the data structure as a binary tree, where each node contains
class Node
char theChar
int position; // ie 0 = first character in the file, and 81 could be the first character in the 2nd line
node left,right,parent;
}so how it works is the cursor would know where the location was so i would know where to delete and insert within the tree.
insert {
//search for location to insert after (log n)
//create new character node and append to current node
//increment position for all subsequent children
delete(x) {
search for x position
if found, remove node and decrement position value for all children
goto(line #) {
return line # * 80 (or whatever max length for a single line)
}the major problem i see here is balancing the tree after every insert/delete
Thanks in advance.One of many great things emacs has given us is the gap buffer:
http://en.wikipedia.org/wiki/Gap_buffer
To see a Java implementation of this you can look in the Java SDK source. The document model (I forget exactly what its called), used in Swing uses a gap buffer. -
sandy - a simple text editor
Sandy is a X11 text editor with an easy-to-read, hackable C source. It uses GTK+ and GtkSourceView for convenience and is akin to surf, only it is a text editor, not a web browser. Sandy tries to maximize screen estate, minimize the SLOC used and not get in your way too much. It can somehow be controlled via XProperties and all preferences and keybindings are to be chosen at compile time. Two example configs are provided with the source.
Features
- Basic editing, saving, etc.
- One document per instance
- Embeddable (e.g. can use http://tools.suckless.org/tabbed for tabs)
- Regex search, go to line functionalities
- Pipe selection through arbitrary command
- Pipe selection through predefined command(s)
- Syntax highlighting
- Line numbers, current line highlightnig
- Simple autoindenting
- Multi-level undo
- Configurable at compile-time
Dependencies
- GtkSourceView2
- Gtk+2
- (probably) xorg-utils to get xprop to set XProperties
- one method to grab user input: either zenity or dmenu in the pre-defined config files
Screenshot
http://sandyeditor.sf.net/sandy_editor.jpeg
Homepage
http://sandyeditor.sf.net/
Download
http://sourceforge.net/projects/sandyed … z/download
AUR
http://aur.archlinux.org/packages.php?ID=36084
Comments, bug reports and patches welcome.
Last edited by rafunchi (2010-04-13 23:24:26)Procyon wrote:
It would be nice to be able to do something like this:
1 abc
2 dec
3 abd
4 edc
5 {CURSOR}ad
^R, sed command: 1,3s/^/%%%/
1 %%%abc
2 %%%dec
3 %%%abd
4 edc
5 {CURSOR}ad
So you can edit and continue where you left off.
The problem with implementing this behavior is 'sed' is an external command here. The full text is filtered through sed and put back in the buffer, not just lines 1 to 3. You can't just preserve the insert position as the text coming from the pipe might be completely different from your original. Same for searching the current line.
You *could* remember your line+char position and move the cursor back there, but this would be highly unreliable and move the cursor to a third position in the buffer if your 's' command changes the number of lines (e.g. try s/:/\n/g in a password file)
Also, a couple of tests with vim prove that it does not behave consistently in this regard, despite :s being an internal command there.
if you really want to add '%%%' at the beginning of the line quite often, I suggest you define a binding or action for:
t_editable, t_pipelines, { .v = (char *)"sed \'s/^/%%%/\'" }
Then select the lines you want to target lousily (you don't need to select full lines) and launche the binding/action. It does move the cursor, but seems fairly quick.
Procyon wrote:Maybe you can check for "/^s/" in the command to make it work on this current line, just like vim's :s///
I made a wee change in the hg tip code. Now sandy "listens" to three properties regarding pipes:
- _SANDY_PIPE: Pipes the selected text, or nothing by default as per f_pipe. This is used by the ^I binding in the default config.
- _SANDY_PIPEALL: Pipes the selected text, or the full file if nothing is selected as per f_pipeall. This is used by the ^P binding in the default config.
- _SANDY_PIPELINES: Pipes the selected text, extending the selection to full lines and matching the current line if there is no selection as per f_pipelines. This is used by the ^R binding in the default config. This means now sed is applied to full lines if there is a selection and to the current line if there is not.
Thanks for your feedback. I hope this helps. -
Help with images within applets
I created a card game applet which calls images placed within the same directory. In appletviewer the game runs fine,not in browsers. I downloaded the browser plugin since i use swing classes. If I remove the image the applet loads up without the grafix. Here is the IO error generated. I thought applets can read files within the same directory and sub directories? Would creating a jar file solve this problem? Anyhelp would be appreciated.
java.security.AccessControlException: access denied (java.io.FilePermission main2.gif read)When running in a browser, your applet must be signed in order to be able to access local resources. Check out the "Signed Applets" forum for many discussions about this, as well as methods for signing applets.
Maybe you are looking for
-
Best way to migrate away from network homes?
I have four users with networked homes and for a variety of reasons I'd like to put their homes on their local machines and delete them from the network server. Is there an easy way to go about this?
-
I have built a small presentation into numbers. Number of pages in total 46. Pages 1 - 24 contain content which i want to convert into a pdf file. Pages 25-46 are blank but I cannot delete these pages. Therefore when I print and convert into pdf ther
-
So a few years ago, we had one email address that was my user ID and that apps were downloaded to. Then I got a new phone, cancelled that email provider (not thinking about my phone and itunes) and signed up with Gmail, therefore giving myself a new
-
Is there a way to shut off 3g network and still have the WiFi working?
My Dads going overseas and wants to use his Wifi but dosen't want to be charged using the 3G network.
-
Report progress: RWRUN60.EXE - Application Error
The instruction at "0x00244e56" referenced memory at "0x00000004". The memory could not be "read" Click OK to terminate the program Click on CANCEL to debug the program I have developer 6i reports 6.0.8.8.3 and Oracle database 8i 8.1.7.4.0 64 Bits Wi