Piv to Image Array
I have a program on my computer called Pivot Stickfigure Animator which I use to make graphics. Is there a way to read a Pivot file into an Image Array?
compdude wrote:
It exports animated gifs. Can I convert it to image array?Here's some code I wrote in 2004: [http://forum.java.sun.com/thread.jspa?threadID=425360&start=17]
I'm sure there are 3rd party libraries to help you do this, but I don't know of any other way to do it in the J2SE API.
Similar Messages
-
Please Help!-Problem using Image[ ] array
Hi everyone,
I have this real confusing bug in my code which i am not able to fix.
Image[] tmpImg = new Image[Img.size()]; /initializing an image array tmpImg
for(int i=0; i<Img.size(); i++) { //i require this display the image a number of times
try{
icon = Image.createImage("/Icon.png");
im = new ImageItem("Image", icon,ImageItem.LAYOUT_CENTER,"image"); //using a imageItem to display the image in a form
form.append(im);
icon2 = Image.createImage("/Icon2.png");
im2 = new ImageItem("Image2",icon2,ImageItem.LAYOUT_CENTER,"image"); //using another imageItem to display the second image
form.append(im2);
if (imageValue.elementAt(i) == "availableImage") {
tmpImg[i] = icon; //assigning the value to the image array based on a condition from a String Vector
if (imageValue.elementAt(i) == "offlineImage") {
tmpImg[i] = icon2; //assigning the value to the image array based on a condition from a String Vector
} catch(IOException err) {}
System.out.println(tmpImg[0]);
System.out.println(tmpImg[1]);
System.out.println(tmpImg[2]);
System.out.println(tmpImg[3]);
return tmpImg;
}My problem is that when i try to print tmpImg[0], tmpImg[1] etc all the values are printed null. But the Image is created and being displayed on a ImageItem. but i am not able to assign the image to the image array 'tmpImg' which is within an if condition.
Can anyone tell me why is this so. I would be grateful
Thank YouThank u deepspace
I got a lil' frustrated, so completely did not think that way. The code is working now
Thanx again -
I'm lookking for a solution for this problem: I have a binary 2D array of an image. Now I want to search for and count all "1" (= high) values in the 2D array. Please help me to solve this problem. Thx.
I don't know what a "binary image array" is, but if you mean a 2D boolean array, you can wire it into Boolean to (0,1) and wire the output of that into Add Array elements (Boolean and Numeric palettes).
If that doesn't help, you should post your VI so we can see what your array looks like.
To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).
Try to take over the world! -
I am attempting to get an image array from a 32 Bit image. I
attempted to use IMAQ ImageToArray. This did not work when
passing in a 32bit RGB image. It works fine after I convert the
image to 8 or 16 bit image, but this is a step I am attempting to
remove. So, my main questions is there a way to get an Array of
an image directly from a 32 Bit Image?In the Color Utilities there is a function called IMAQ Color Image to
Array. That is the one you want to use. Hopefully you have the Vision
Development module or you may not have access to this vi.
Randall Pursley -
Need Help Creating Image Array
Hello,
I am a newbie at Flex 2 and I am working on this site that
needs an image array consisting of 5 images. The ideal thought
would be for the images to load into an HBox I created as a holding
place and have the images change every 5 seconds or so. I have
looked around the forums and the internet but I have yet to find
anything. If anyone can please help me on this I would greatly
appreciate it.
Regards,
JoseIf you've done what I think you have, then I may have tried something similar.
I tried creating a BufferedImage in a JPanel, basing the size of the BufferedImage on the size of the JPanel in the constructor, but when the JPanel was created, it tried to set up the image before resizing the JPanel i.e. the BufferedImage size was set to (0,0) and that threw an IllegalArgumentException at runtime. I found that I had to declare variables for an initial image size, then optionally change the image size later.
Hope that helps. -
How can I put three jpgs in an Image array declared as follows:
Image[] images; is this an array?
can I do somewthing like that:
i am getting the names of the images from a command line argument.
if user types ShowPic house jpg 2
I want to put in the array house0.jpg and house1.jpg
Images[] images;
public ShowPic(String image, String type, int num)
for (int i=0;i<num;i++)
images[i] =tKit.createImage(image+i+"."+type);
public static void main(String[] args)
ShowPic showPic = new ShowPic(args[0],args[1], Integer.parseInt(args[2]));here you go!
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.Graphics;
import java.awt.Color;
import java.awt.*;
import javax.swing.*;
import java.util.*;
import java.awt.image.*;
public class ShowPic extends JFrame implements Runnable{
Image[] images;
int current_image=0;
int maxNumber;
Toolkit tKit = Toolkit.getDefaultToolkit();
Thread th;
Graphics g;
JPanel panel;
public ShowPic(String image, String type, int num) {
panel=new JPanel();
panel.setSize(getWidth(),getHeight());
maxNumber=num;
images = new Image[maxNumber];
for (int i=0;i<maxNumber;i++) {
images=tKit.getImage(image+String.valueOf(i)+"."+type);
System.out.println(image+String.valueOf(i)+"."+type+" added");
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setSize(500,500);
this.setContentPane(panel);
this.setVisible(true);
th = new Thread (this);
th.start ();
public static void main(String[] args) {
try {
System.out.println(args[0]+" "+args[1]+" "+(Integer.parseInt(args[2])));
ShowPic showPic = new ShowPic(args[0],args[1], Integer.parseInt(args[2]));
} catch (NullPointerException e) {
System.out.println("Something is wrong!");
public void run() {
while (true) {
System.out.println("Thread is true - animate");
animate(g);
try {
Thread.sleep(100);
}catch (InterruptedException e) {
System.out.println(e);
}//end of method
public void animate(Graphics g){
if ( current_image == maxNumber-1){
current_image=0;
}else{
current_image++;
paint(g);
public void paint(Graphics g) {
if(g == null){
g=panel.getGraphics();
g.setColor(Color.WHITE);
g.fillRect(0, 0, getWidth(), getHeight());
g.setColor(Color.BLACK);
g.drawString(""+current_image,10,10);
g.drawImage(images[current_image],10,10, this); -
How do i convert a picture back to a image array and extract the coulor table.
Been trying to do so for the past 2 weeks and the folks at NI India also are unable to support me. please help. I am on labview 6.1
AnkurI suppose that you are talking about a LV picture.
My opinion is that LV 6 was an absolute pity for picture management. LV 7 is only a pity.
Your problem could be solved in a breath using a few of the IMAQ vision tools. Unfortunately, NI has decided to keep separated its image management tools from its graphic development environment. I think that this situation should be discussed...
With LV 6, there is probably a solution that use the Flatten to String function, convert the string to a 1D-array of bytes, remove the 32 bytes or so the Flatten function has added before the actual picture bytes, then reshape the array according to the initial picture size. I have done that in the past for a 8byte picture. Not sure if it is as simple for a colored picture. Not sure either if I'll have some time to spare on the problem today.
Hope you will find here some more constructive help !
CC
Chilly Charly (aka CC)
E-List Master - Kudos glutton - Press the yellow button on the left... -
I'm using a modified version of Romain Guy's music shelf (http://www.curious-creature.org/2005/07/09/a-music-shelf-in-java2d/), using it as an applet in an extension for a mozilla based media player.
In order to allow decent performance I'm using a proxy pattern, so the images are not actually loaded until they're needed. All the proxies are stored in a simply java array at startup. When more than 100 of the proxies have loaded their image, the whole thing slows down, and when 113 (exactly and always) have loaded, the applet freezes completely.
Anyone got any idea why this might be happening?? There's plenty of memory left and the applet is run localy so it shouldn't be security probem either.Nevermind..... a classic case of RTFM. I might have enough memory, but java only has 64mb....
-
I am currently trying to insert a 20X20 image a specific spot on an array spot[X][Y], but do not know how to get them in the array.
Can anyone help me?
I am using JPanel and want the images to be displayed within the GUI.AWebster wrote:
How would i be able to do this? By reading the Sun Swing tutorials JLabel section and by playing with JLabels and ImageIcons first before trying to incorporating them into your main application.
And sorry im a Beginner, but would this mean i would have to make 100 separate JLabels to fill the 10X10 grid for the array?Yes, you'd have to make 100 JLabel objects, but not 100 separate JLabel variables as all the JLabel objects would be held in a single 10 by 10 array.
Is this a memory game application? -
2d (image) (array) smoothing algorithm
Hello:
I am attaching images prior to and after applying a proprietary smoothing algorithm (not in LabVIEW). I have tried to duplicate this smoothing using a variety of algorithms including up to10x spline interpolation as well as smoothing options available in Vision (low-pass filtering, local average, guassian, median filtering [after converting to 8-bit grayscale image]) but cannot come up with nearly as good of smoothing effect as that shown here as I always still see some pixelation. Any ideas for high quality smoothing algorithms for 2d arrays (images) using LabVIEW?
Thanks,
Don
Attachments:
test.png 32 KB
test_smoothed.png 74 KBDon
Do you have the raw data?
The pixels are highly rectangular, so it would be important to have the raw data without the repeated pixels in the x direction. (sure, I could probly add some code to extract it, but why?)
Each image column is already quite smooth, so what you need to do is reduce the x dimensions to a set of unique slices and then interpolate to generate the new, smooth, rows at the present scale to end up with to square pixels again.
Here's a quick attempt using 2D circular comvolution with a Gaussian of 0.1% width in y and 3% width in x. I am sure once you can post the raw data, things will fall into place just fine.
Message Edited by altenbach on 07-09-2008 02:55 PM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
Smoothed.png 292 KB -
Strange behaviour with Vision 8.2 and Shared Variable 1D Image Array
I've just upgraded to LabVIEW 8.2 and Vision 8.2. When loading a particular VI, it is searching numerous times for ...\LabVIEW 8.2\resource\objmgr\IMAQ Image.ctl - which of course doesn't exist. As best as I can track it down, this seems to be cause by a Shared Variable I have in the project which is a custom control of a 1D array of Image.
So I've created a new project from scratch to illustrate (attached). The VI runs OK, but any editing means that this non-existant control is searched for again. Of interest is also that there is a coercion dot where the Image is used, but the data type on the wire seems OK. Creating a control (rather than a Shared Variable) works fine.
Anyone know what's going on here?
Message Edited by GregS on 02-26-2007 03:43 PM
Attachments:
1DImage.png 4 KB
1DImageShared.zip 15 KBHello Greg,
I downloaded your project and opened it up on my
system. I received the same results as you
did – I tried to open the project it searched for \LabVIEW 8.2\resource\objmgr\IMAQ Image.ctl. I also used the 1d Image.ctl file as a constant on my block diagram and it did not
show the coercion dot as you mentioned.
There does seem to be some strange behavior going on here
with the coercion dot and the shared variable.
I will have to look further into it and report this to R&D.
But for now, we need to address your application. What is the goal of your application? How does using a shared variable with IMAQ
Images help you get there? You may be
aware of this already, but when an Image wire is passed around LabVIEW, it is
not actually passing a copy of the data in a dataflow manner. The large size of IMAQ Images necessitates
that LabVIEW pass around a pointer to the IMAQ Image. Therefore, when an array of Image controls is
made and used as a shared variable, the controls do not contain the actual
image data. Instead, they contain
pointers to the IMAQ Images. When they
are passed into a shared variable, unexpected results may occur. If the shared variable is network published,
for example, another computer on the network would receive a pointer to an
image that it would not be able to find or access.
There may be a much better way than shared variables to
achieve the same functionality you are currently looking for. If you do in fact require shared variables,
you could use IMAQ ImageToArray.vi
to create an array that can be used in the shared variable like any other data
type, and then use IMAQ ArrayToImage.vi
on the other end to be able to view the array as an image.
Please post back with more information about your
application and we should be able to find the best solution for you.
Regards,
Luke H -
ive recently created a simple portfolio site for my
girlfriend. the images are stored in an array, and the viewer
cycles through the images by clicking on them, javascript is used
to change the image. at first glimpse it appears to work fine, but
a problem is created if the browser is too small to fit the entire
page. if the viewer has to scroll down to see the image clearly, as
soon as the image is clicked to change to the next one the browser
jumps back to the top of the page. you can see the problem at this
url:
please shrink the browser, scroll to the bottom of the page
and click the image to understand the problem im having. any
solutions or alternatives suggested would be greatly appreciated.
many thanksChange this -
<a href="#" onclick="changeIt('image2')"><img
src="IMAGES/sh4.jpg"
border="0" alt="one" /></a><h3>Image 1 of 5.
Click to change</h3>
to this -
<a href="#" onclick="changeIt('image2');return
false"><img
src="IMAGES/sh4.jpg" border="0" alt="one"
/></a><h3>Image 1 of 5. Click to
change</h3>
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"jimmyweave" <[email protected]> wrote in
message
news:g5519v$2gf$[email protected]..
> ive recently created a simple portfolio site for my
girlfriend. the
> images are
> stored in an array, and the viewer cycles through the
images by clicking
> on
> them, javascript is used to change the image. at first
glimpse it appears
> to
> work fine, but a problem is created if the browser is
too small to fit the
> entire page. if the viewer has to scroll down to see the
image clearly,
> as
> soon as the image is clicked to change to the next one
the browser jumps
> back
> to the top of the page. you can see the problem at this
url:
>
>
http://www.jodie-silsby.com/portsmouth.html
>
> please shrink the browser, scroll to the bottom of the
page and click the
> image to understand the problem im having. any solutions
or alternatives
> suggested would be greatly appreciated. many thanks
> -
Bmp image array, how to draw it on page
I do not mess arround with Flex all to much so forgive the poor question title.
I do not use Flex to open a socket connetion to an embedded device. From there i send and get information.
I need to display a 320x240 image. I cannot use the typical way for getting an image like i have see you guys use for nabing it from a server. I have to send the data up through this socket connection. I can handle all that. So to make things simple lets say i have created an array of the image data in RGB or BGR format. How can i draw out this data.When you do any displayable graphic manipulation in Java it's usually going to be through an override in your paint/paintComponent (awt/swing). You need to read the Java tutorial on how to do graphics--here is a rough on how:
I'll assume you want to have a graphic object to save when you are done--
get the graphic context of your image (look in the API under BufferedImage--I suggest using BufferedImages)
make a change to the graphic context of the image
call repaint()
Graphics2D biGraphics = bi.createGraphics();
//your code here to make changes to the image
//by manipulating the Graphics context biGraphics
repaint();Now your override for paintComponent (I'll assume you are using SWING for this and your image name is bi).
public void paintComponent(Graphics g){
super.paintComponent(g);
g.drawImage(bi, 0, 0, this);
} -
How to add byte[] array based Image to the SQL Server without using parameter
how to add byte[] array based Image to the SQL Server without using parameter.I have a column in table with the type image in sql and i want to add image array to the sql image column like below:
I want to add image (RESIM) to the procedur like shown above but sql accepts byte[] RESIMI like System.Drowing. I whant that sql accepts byte [] array like sql image type
not using cmd.ParametersAdd() method
here is Isle() method contentSQL Server binary constants use a hexadecimal format:
https://msdn.microsoft.com/en-us/library/ms179899.aspx
You'll have to build that string from a byte array yourself:
byte[] bytes = ...
StringBuilder builder = new StringBuilder("0x", 2 + bytes.Length * 2);
foreach (var b in bytes)
builder.Append(b.ToString("X2"));
string binhex = builder.ToString();
That said, what you're trying to do - not using parameters - is the wrong thing to do. Not only it is insecure due to the risk of SQL injection but in the case of binary data is also inefficient since these hex strings are larger than the original byte[]
data. -
Loading images from an Array generated from XML
OK, this is my first day trying to use AS3 and I'm kind of
confused on how to load an image onto the screen and then be able
to resize it, scale it, etc..
I'm loading up to 5 images in from an XML file that will be
generated on a server. (right now I'm just using a test.xml file).
Normally I would load the images into dynamically created
movie clips (whatever0_mc through whatever4_mc generated by code in
AS2). But I can't seem to get anything working.. I've looked on the
internet and read through some information but I'm still just
REALLY confused... this is what I have so far. To make it easier on
me in the future, I've put different code on different layers so I
can look at it closer.. I've separated the code into the different
layers they're on here:
First Layer:
import flash.events.Event;
import flash.net.URLLoader; // URL Loader Import for Images
import flash.net.URLRequest; // URL Requests Import for
Images
import flash.display.Loader; // Loader
import flash.events.ProgressEvent; // Progress for Loader
import flash.text.TextField; // Imports for Text Fields
import flash.display.Sprite; // Imports Sprite stuff for
loaded Images
import flash.display.Bitmap; // Imports stuff to display a
bitmap
Second Layer:
var imgLoader:Loader = new Loader(); // Initialize Image
Loader
// Listeners for the Image Loaders //
function showPreloader(evt:Event):void {
trace("-- ** showPreloader ** --");
addChild(loadProgress_txt);
function showProgress(evt:ProgressEvent):void {
trace("-- ** showProgress ** --");
var totalLoaded:Number = evt.bytesTotal;
var currentLoaded:Number = evt.bytesLoaded;
var thePercent:Number = (currentLoaded * 100) / totalLoaded;
loadProgress_txt.text = thePercent + "%"; // Show bytes
loaded
function showLoadResult(evt:Event):void {
trace("-- ** showLoadResult ** --");
Third Layer:
// Setup Variables //
var imageArray:Array = new Array();
var galleryTitle:String;
var numPhotos:Number;
var gallerySubmitter:String;
// XML Info //
XML.ignoreComments = true;
XML.ignoreWhitespace = true;
var galleryXML:XML;
var xmlLoader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest("test.xml");
xmlLoader.load(request);
xmlLoader.addEventListener(Event.COMPLETE, XMLComplete);
function XMLComplete(evt:Event):void {
trace("-- ** XMLComplete ** --");
var loader:URLLoader = evt.target as URLLoader;
if (loader != null){
galleryXML = new XML(loader.data);
galleryTitle = galleryXML.children()[0].attributes()[0];
numPhotos = galleryXML.children()[0].attributes()[1];
gallerySubmitter = galleryXML.children()[0].attributes()[2];
trace("galleryTitle: " + galleryTitle);
trace("numPhotos: " + numPhotos);
trace("gallerySubmitter: " + gallerySubmitter);
for(var i:Number = 0; i<numPhotos; i++) {
imageArray.push(galleryXML.children()[0].children()
.attributes()[1]);
} // for(var i:Number = 0; i<numPhotos; i++)
trace(imageArray.toString());
trace("loading: images\\gallery\\" + imageArray[0]);
var imgRequest:URLRequest = new
URLRequest("images\\gallery\\" + imageArray[0]); // Request the
Image into the Loader
imgLoader.load(imgRequest);
imgLoader.contentLoaderInfo.addEventListener(Event.OPEN,showPreloader);
imgLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,showProgress);
imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,showLoadResult);
} else { // if (loader != null){
trace("loader is not a URLLoader!");
} // if (loader != null){
} // function onComplete(event:Event):void {
// End XML Info //
Can anyone point me in the next direction?
thanks...When you used the IMAQ create VI you specified each image to use the same name of "image". Each image has to have a unique name. I edited your VI to give a unique name for each image and I was able to view three different images in three different viewing panes.
Attachments:
Image Array Reworked.vi 19 KB
Maybe you are looking for
-
How to change number range for document type ?
Dear All Experts How to change the number range for document types for entry view? I am trying to change the number range for all document type as per defined ranges in FBN1, but at the time of saving document type and number range the system is thro
-
Problem during uploading of .par file in Portal
Hi, I am downloading a properly working .par file from portal in my local system. But whenever I am uploading the same par file back into the portal through NWDS, the .par file is not running properly and its Giving error. Here is the error: "Caused
-
Many programs I used to use in Tiger doesn't work in Leopard
Here are the ones I've noticed have not been working or have errors: iMovie iChat Yahoo Messenger Adium VisualHub There are probably like 10 more but I haven't seen it yet. Why are so many programs are acting like this. I was thinking it was becasuse
-
I want to watch movies from my laptop on my TV - how do I go about doing that?/what do I need?
-
Userexit_move_field_to_vbap.
i have added a new column in the screen 4900 of sales order which corresponds to the field zzitbsez in vbap table . i have added this field in vbap . I wrote code in userexit_move_field_to_vbap to move values MOVE xVBAP-ZZITBSEQ TO VBAP-ZZITBSEQ. in