Help: BufferedImage image data order

I want to create an image by myself. What I have is the width, height and image data. The image data is arranged B,G,R,B,G,R,.... However, when I call BufferedImage constructor with the image type TYPE_3BYTE_BGR and use setPixels to input the data. The color of resulting image is wrong.
The setPixels() function apparently assume the input image data is arranged R,G,B, R,G,B,...
Here is the snippet of code:
imagedata = new BufferedImage(width,height,BufferedImage.TYPE_3BYTE_BGR);
WritableRaster raster = imagedata.getRaster();
raster.setPixels(0,0,width,height,image);I have specified the image type is Type_3Byte_BGR, the setPixels should know the input image has the order of B,G,R. Does the setPixels function assume the fixed order (R,G,B) no matter what the image type is ?
Thanks.

In all the reading I've done with Rasters, there seems to one word that jumps out at me over and over again--"standard". I've not had the occasion to use anything other than RGB, but with as heavily as "standard" is used in what I've read to do what I have had to do, it wouldn't suprise me if RGB was the "standard" used in Rasters.
I'd be interested if you find anything different.
Thanks,
Les

Similar Messages

  • HELP! "Image Date" = "Created Date" + 12 hrs Why?

    Over Christmas and New Year's Eve, I took a number of images with a Kodak C663 digital camera. I am quite pleased with the camera, however, when I import the images, some of the images have Image Dates 12 hours later than the creation date.
    i.e.
    Image Date: 12/31/2006 12:15:50 AM MST (CA)
    Created Date: 12/30/2006 12:15:50 PM MST (CA)
    The error in the Image date does not occur on all images, and the date on the camera was not change during that period. Quite perplexing.
    Is there a way to correct the actual Image Date so that I can have the correct information in Aperture. I understand Timeature will change the date in Aperture Database, but I do not want that. I want to correct the actual data in the image file.
    Any help will be greatly appreciated.
    TIA
    * BTW - I can easily correct the image date in iPhoto, and the change does seem to carry over when I import the iPhoto Rolls to Aperture. So, as a workaround, if the image date is know to be wrong, importing into iPhoto and then into Aperture, may be a kludgy way to correct an images date.
    Dual G5 2.5 GHz Dual Core, 2.5 GB RAM, 500 GB HDD   Mac OS X (10.4.7)   iLife 06, Final Cut Studio

    As mentioned, previously, I am going with the iPhoto re-dating ability to resolve problems with Creation date. It seems to be the most reliable as I can address each photo's time shift.
    Ta
    Gary

  • Extract image data from a bitmap image in C# HELP Please!!

    Hi there, 
    I am trying to extract the image data from a bitmap file - i.e. delete the image's BMP header.
    But I keep getting an error (System.IndexOutOfRangeException) in line 85 (if I am not mistaken) inFilename = args[0];
    Where the Console Application just crashes. 
    https://msdn.microsoft.com/query/dev12.query?appId=Dev12IDEF1&l=EN-US&k=k(EHIndexOutOfRange);k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.5);k(DevLang-csharp)&rd=true
    Any idea what is going wrong? 
    I thank you for your time and help in advance,
    IP
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    namespace ConsoleApplication1
    class Program
    private static string inFilename, outFilename;
    private static string errorMessage;
    private static void ShowUsage()
    Console.WriteLine("BMP2CSV by David Bolton. http://cplus.about.com (C) 2013");
    Console.WriteLine(@"Usage: bmp2csv input[.bmp] [output.csv]");
    Console.WriteLine(@"[means optional]");
    Console.WriteLine("Input extension must be .bmp, ouutput (if supplied) .csv");
    private static bool outputCsv(byte[] data, int width, int height)
    try
    using (var sw = new StreamWriter(outFilename))
    var ptr = 0;
    for (var y = 0; y < height; y++)
    var line = new StringBuilder();
    for (var x = 0; x < width; x++)
    line.Append(data[ptr++].ToString()).Append(',');
    sw.WriteLine(line);
    return true;
    catch
    Console.WriteLine("Error writing to " + outFilename);
    return false;
    private static bool ProcessFile()
    try
    using (var filein = new BinaryReader(File.OpenRead(inFilename)))
    var Signature1 = filein.ReadByte(); // now at 0x1
    var Signature2 = filein.ReadByte(); // now at 0x2
    if (Signature1 != 66 || Signature2 != 77) // Must be BM
    errorMessage = "Input File is not a BMP file";
    return false;
    filein.ReadDouble(); // skip next 8 bytes now at position 0xa
    var Offset = filein.ReadInt32(); // offset in file now at 0ea
    filein.ReadInt32(); // now at 0x12a
    var fileWidth = filein.ReadInt32(); // now at 0x16
    var fileHeight = filein.ReadInt32(); // now at 0x1a
    filein.ReadBytes(Offset - 0x1a); // should now be at offset bytes into file
    var data = filein.ReadBytes((int)filein.BaseStream.Length - Offset);
    // read remainder of file into data- array of bytes
    //Console.WriteLine("Data Length = {0}",data.Length);
    return outputCsv(data, fileWidth, fileHeight);
    catch
    errorMessage = "Error reading " + inFilename;
    return false;
    private static void Main(string[] args)
    errorMessage = "Ok";
    if (!ExtractParameters(args))
    return;
    if (!File.Exists(inFilename))
    Console.WriteLine("Cannot find file " + inFilename);
    return;
    if (ProcessFile())
    Console.WriteLine("file successfully processed - output in " + outFilename);
    else
    Console.WriteLine("File processing failed: " + errorMessage);
    private static bool ExtractParameters(string[] args)
    inFilename = args[0];
    var extension = Path.GetExtension(inFilename);
    if (extension.Length == 0)
    inFilename += ".bmp";
    else
    if (extension.ToUpper() != ".BMP")
    ShowUsage();
    return false;
    switch (args.Count())
    case 1: // No output filename so swap extensions
    outFilename = Path.GetFileNameWithoutExtension(inFilename) + ".csv";
    break;
    case 2:
    { // check outfiulename has no extension or a .csv only
    outFilename = args[1];
    extension = Path.GetExtension(outFilename);
    if (extension.Length == 0)
    outFilename += ".csv";
    else if (extension.ToUpper() != ".CSV")
    ShowUsage();
    return false;
    break;
    default: // no parameters? You get the usage message
    ShowUsage();
    return false;
    return true;

    You probably did not specify the command-line arguments, i.e. the name of input and output files. In order to do this in Visual Studio for debugging, see
    https://msdn.microsoft.com/en-us/library/vstudio/1ktzfy9w(v=vs.100).aspx. So type something like “C:\My Folder\MyFile.bmp” “C:\My Folder\MyOutput.csv”, including quotation marks, according to your real disks and paths.
    The program should be fixed to detect such errors and call
    ShowUsage. Maybe ask the author.

  • BufferedImage data order

    I want to create an image by myself. What I have is the width, height and image data. The image data is arranged B,G,R,B,G,R,.... However, when I call BufferedImage constructor with the image type TYPE_3BYTE_BGR and use setPixels to input the data. The color of resulting image is wrong.
    The setPixels() function apparently assume the input image data is arranged R,G,B, R,G,B,...
    Here is the snippet of code:
    imagedata = new BufferedImage(width,height,BufferedImage.TYPE_3BYTE_BGR);
    WritableRaster raster = imagedata.getRaster();
    raster.setPixels(0,0,width,height,image);I have specified the image type is Type_3Byte_BGR, the setPixels should know the input image has the order of B,G,R. Does the setPixels function assume the fixed order (R,G,B) no matter what the image type is ?
    Thanks.

    In all the reading I've done with Rasters, there seems to one word that jumps out at me over and over again--"standard". I've not had the occasion to use anything other than RGB, but with as heavily as "standard" is used in what I've read to do what I have had to do, it wouldn't suprise me if RGB was the "standard" used in Rasters.
    I'd be interested if you find anything different.
    Thanks,
    Les

  • Photos. They are on my macBook, backed up on time machine. Copied them (hours and hours) to external hard drive. They are now in alphabetical order (19,000  of them) NOT IN THEIR EVENTS or date order-and have been taken with different cameras- help!!!!!!

    Photos.
    They are on my macBook, backed up on time machine. There are 19,000+ of them, some rescued from a pc crash- which I used the nifty iPhoto to put back into date order.    
    I want to take them all off my laptop, now............as I need to use it for WORK!!
    Copied them (hours and hours) to another external hard drive.
    They are now in alphabetical order (all 19,000+ of them) NOT IN THEIR EVENTS or date order. (-They have also been taken with different cameras over the years and some of the generic camera numbering remains.)
    I have tried to copy them (only a few as an experiment)  one event at a time, but that again "opens up" the Event "folder" and tips them out as individuals and therefore just lists image letters and numbers alphabetically.
    How can I copy
    the whole library still in  "Events" to an external hard drive?
    the folders/albums I have already made on to this hard drive?
    and how can I add to this back up monthly, again keeping events and folders separate and updated?
    Mac is so user friendly - there must be a way.........
    Thanks

    UPDATE : I have re-installed from disk, various apps that were no longer functioning such as iLife, iWork etc. So, I now can access my photos again.
    Also, I had to re-install all the software for my printer ( Stylus Pro 4880 ) and reset it so the printer is working again.
    Photoshop CS4 won't open. I think I will have to get in touch with Adobe as basically, I guess they have a built-in "blocker" which prevents me from opening the app as the license is for only 1 user and having re-installed the OS, there are now, in effect, 2 users ( Me and Me 1, I think ).
    So, having added on a new external HD, Time Machine has made a copy of most of the files, folders, apps etc onto the external HD. The internal HD is still nearly full ( 220 GBs out of 232 GBs ).
    I am guessing the way to go now in order to free up space on the internal HD is to delete/trash older photos from my iPhoto library and hope that if needed, I will be able to access them on the external HD.
    Am I correct ? Please advise before I do something I will regret.
    Thanks, Sean.

  • Help! Read raw Image data from a file and display on the JPanel or JFrame.

    PLEASE HELP, I want to Read Binary(Raw Image)data (16 bit integer) from a file and display on the JPanel or JFrame.

    Hey,
    I need to do the same thing. Did you find a way to do that?
    Could you sent me the code?
    It's urgent, please.
    My e-mail is [email protected]

  • What type of BufferedImage is needed for 24 bit image data

    Hello, i am using an image processing api, i have a 24 bit image data, i want to form a BufferedImage and set its pixel values with my data such as
    BufferedImage image = new BufferedImage(w, h, what type?);
    WritableRaster raster = image.getRaster();
    int[] imgpixels = ((DataBufferInt) raster.getDataBuffer()).getData();
    for (int i = 0; i < image.getHeight() * image.getWidth(); i++)
    imgpixels[i] = ((myArray).getRed()) << 16 | ((myArray[i]).getGreen()) << 8 | ((myArray[i]).getBlue());
    Then i will save the Buf. image to file as png. So what type of BufferedImage do i need?
    Regards.

    what is the reason when i read a 24 bit png image...it shows the type as 0 (TYPE_CUSTOM) ?
    From the the Field Detail section for the TYPE_CUSTOM field in BufferedImage: the image type is not recognized.
    You could make a new BufferedImage with TYPE_INT_RGB, or TYPE_INT_ARGB if the image has or will have transparent pixels, and copy the TYPE_CUSTOM image into it. Then you can manipulate/process the new image.

  • HT5167 image data corrupted message when installing anything. Please help!!

    A couple of days ago something happened and now every time I tried to install an app i receive the following mesage: (app being installed file name).dmg image data corrupt. Can anyone point me in the right direction please???

    All of the posters need to take their system to an Apple Genuis bar and have whatever is wrong with them fixed.
    It is either some software you have installed. The hard drive has become corrupted in some way or you have a hardware problem.
    Or all of the above.
    Wish all of you good luck.

  • Running totals help required. Total PartNumber when in Date Order / Group.

    I am trying to create a shortages list of our order book for all our customers orders outstanding. I want a running total of the orders which works until I group the orders in date order, not PartNumber order. It needs to be in date order so the users has a priority order for jobs. What is the best ways to do a running total of the quantity required where the PartNumbers match but keep it in date order.

    Hi,
    Welcome you post on the forum.
    Do you need query for one selectable PartNumber or all PartNumbers?
    Thanks,
    Gordon

  • Best method of reading RGB image data?

    Hi all
    I scanned the forums for this and am sure you have all been asked it a million times, but I'm a little unclear
    What is the best image format to use to read RGB values from image data & eventually save these values for manipulation, hopefully not going into JAI (as never used) if can be helped. I had been advised to use .BMP by my lecturers but as this is not directly supported by Java was wondering what the next best format would be.
    At a guess it looks to be .gif but if this is not the case would appreciate any advise

    I'd go png: jpeg is losey by default and gif uses a palette:
    BufferedImage image = ...
    boolean success = ImageIO.write(image, "png", file);
    //elsewhere
    BufferedImage image = ImageIO.read(file);

  • Image Date conventions for scans/copies?

    Hello Aperturers;
    Just searched for a few keywords without success. What I'm about to do is digitally photograph and scan old photo prints/news clips/negatives/slides for use in Aperture.
    Some of the images don't have a date or a specific one. Say, an old family photo might not be marked at all, or only with a year, or one could guesstimate based on apparent ages of people in the photo.
    I'd like as much as possible to have these digitized files line up in sequential order, and am wondering what techniques folks use to assign image dates, either changing EXIF in Aperture or adding IPTC fields.
    For instance, if I decide an unmarked photo is from 1925, what month/date to use, or will Aperture accept blank month/date? If an image is from a known month/year, then what date?
    Do veterans of this kind of work have a standardized date convention? ie if only the year is known or estimated, is Jan 1 or Dec 31 used? If only month is known, is the 15th used as the date, etc?
    Thanks for the help,
    dave.

    My scanner produced files without exif data, and while Aperture will change exif data, it won't add it to files that do not have it.
    I also wanted my scanned slides and negatives to sort by image date like the digital files.
    There is an excellent donationware program for the mac called SetExifData (www.marc.vos.net). Use this program before importing the files into Aperture to assign image dates. It works well on batches.
    My work flow was as follows: import a bunch of old scanned negatives of a tripor event into a project in Aperture. Use aperture to put them in the right order and then to rename the files with some incrementing naming scheme. Export the project to a folder. The Finder can now keep them in proper order because of the filename change. Use SetExifData to create the exif data and set the capture date to some arbitrarily increasing time/date so they will sort properly by image date. Then Import back into Aperture. They now get treated just like a file from a digital camera.
    I've done this with thousands of old slides and negatives and once done it makes life a lot simpler.

  • [Microsoft][SQL Server Native Client 11.0][SQL Server]The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.  'Items' (OITM) (OITM)

    Dear Experts,
    i am getting the below error when i was giving * (Star) to view all the items in DB
    [Microsoft][SQL Server Native Client 11.0][SQL Server]The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.  'Items' (OITM) (OITM)
    As i was searching individually it is working fine
    can any one help me how to find this..
    Regards,
    Meghanath.S

    Dear Nithi Anandham,
    i am not having any query while finding all the items in item master data i am giving find mode and in item code i was trying to type *(Star) and enter while typing enter the above issue i was facing..
    Regards,
    Meghanath

  • Need help: BufferedImage and zooming

    please help me understand what i am doing wrong. i am having a hard time understanding the concept behind BufferedImage and zooming. the applet code loads an image as its background. after loading, you can draw line segments on it. but when i try to zoom in, the image in the background remains the same in terms of size, line segments are the only ones that are being zoomed, and the mouse coordinates are confusing.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.BufferedImage;
    import java.awt.geom.*;
    import javax.swing.*;
    import javax.imageio.*;
    import java.io.*;
    import java.util.ArrayList;
    import java.io.IOException;
    import java.net.URL;
    import java.awt.image.*;
    public class Testing extends JApplet {
         private String url;
         private Map map;
         public void init() {
         public void start()
              url = "http://localhost/image.gif";
                  map = new Map(url);
                 getContentPane().add(map, "Center");
                 validate();
                 map.validate();
    class Map extends JPanel implements MouseListener, MouseMotionListener{
         private Image image;
         private ArrayList<Point2D> points;
         private ArrayList<Line2D> lineSegment;
         private Point2D startingPoint;
         private int mouseX;
         private int mouseY;
         private BufferedImage bimg;
         private AffineTransform xform;
         private AffineTransform inverse;
         private double zoomFactor = 1;
         public Map(String url)
                         super();
              //this.image = image;
              try
                   image = ImageIO.read(new URL(url));
              catch(Exception e)
              Insets insets = getInsets();
              xform = AffineTransform.getTranslateInstance(insets.left, insets.top);
              xform.scale(zoomFactor,zoomFactor);
              try {
                   inverse = xform.createInverse();
              } catch (NoninvertibleTransformException e) {
                   System.out.println(e);
              points = new ArrayList();
              startingPoint = new Point();
              bimg = new BufferedImage(this.image.getWidth(this), this.image.getHeight(this), BufferedImage.TYPE_INT_ARGB);
              repaintBImg();
              addMouseListener(this);
              addMouseMotionListener(this);
         public void paintComponent(Graphics g)
            Graphics2D g2d = (Graphics2D)g;
              g2d.addRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON));
              g2d.addRenderingHints(new RenderingHints(RenderingHints.KEY_RENDERING , RenderingHints.VALUE_RENDER_QUALITY ));
            bimg = (BufferedImage)image;
            g2d.drawRenderedImage(bimg, xform);
            if(!points.isEmpty())
                 for(int i=0; i<points.size(); i++)
                      if(i > 0)
                           drawLineSegment(g2d,points.get(i-1),points.get(i));
                      drawPoint(g2d, points.get(i));
            if(startingPoint != null)
                drawTempLine(startingPoint, g2d);
            else
                mouseX = 0;
                mouseY = 0;
         private void repaintBImg()
              bimg.flush();
              Graphics2D g2d = bimg.createGraphics();
              g2d.addRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON));
              g2d.addRenderingHints(new RenderingHints(RenderingHints.KEY_RENDERING , RenderingHints.VALUE_RENDER_QUALITY ));
            g2d.drawRenderedImage(bimg, xform);
            g2d.dispose();
         private void drawPoint(Graphics2D g2d, Point2D p)
            int x = (int)(p.getX() * zoomFactor);
            int y = (int)(p.getY() * zoomFactor);
            int w = (int)(13 * zoomFactor);
            int h = (int)(13 * zoomFactor);
              g2d.setColor(Color.ORANGE);
              g2d.setStroke(new BasicStroke(1.0F));
            g2d.fillOval(x - w / 2, y - h / 2, w, h);
            g2d.setColor(Color.BLACK);
            g2d.drawOval(x - w / 2, y - h / 2, w - 1, h - 1);
         private void drawLineSegment(Graphics2D g2d, Point2D p1, Point2D p2)
              double x1 = p1.getX() * zoomFactor;
                 double y1 = p1.getY() * zoomFactor;
                 double x2 = p2.getX() * zoomFactor;
                 double y2 = p2.getY() * zoomFactor;
                 g2d.setColor(Color.RED);
                 g2d.setStroke(new BasicStroke(3.0F));
                 g2d.draw(new java.awt.geom.Line2D.Double(x1, y1, x2, y2));
             private void drawTempLine(Point2D p, Graphics2D g2d)
                 int startX = (int)(p.getX() * zoomFactor);
                 int startY = (int)(p.getY() * zoomFactor);
                 if(mouseX != 0 && mouseY != 0)
                         g2d.setColor(Color.RED);
                          g2d.setStroke(new BasicStroke(2.0F));
                          g2d.drawLine(startX, startY, mouseX, mouseY);
         public void mouseClicked(MouseEvent e)
         public void mouseDragged(MouseEvent e)
              mouseX = (int)(e.getX()*zoomFactor);
              mouseY = (int)(e.getY()*zoomFactor);
              repaint();
         public void mousePressed(MouseEvent e)
              if(e.getButton() == 1)
                   points.add(inverse.transform(e.getPoint(), null));
                   if(points.size() > 0)
                        startingPoint = points.get(points.size()-1);
                        mouseX = mouseY = 0;
                   repaint();
              else if(e.getButton() == 2)
                   zoomFactor = zoomFactor + .05;
                   repaintBImg();
              else if(e.getButton() == 3)
                   zoomFactor = zoomFactor - .05;
                   repaintBImg();
         public void mouseReleased(MouseEvent e)
              if(e.getButton() == 1)
                   points.add(inverse.transform(e.getPoint(), null));
              repaint();
         public void mouseEntered(MouseEvent mouseevent)
         public void mouseExited(MouseEvent mouseevent)
         public void mouseMoved(MouseEvent mouseevent)
    }Message was edited by:
    hardc0d3r

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.BufferedImage;
    import java.awt.geom.*;
    import java.io.*;
    import java.net.URL;
    import java.util.*;
    import javax.imageio.*;
    import javax.swing.*;
    public class ZoomTesting extends JApplet {
        public void init() {
            //String dir = "file:/" + System.getProperty("user.dir");
            //System.out.printf("dir = %s%n", dir);
            String url = "http://localhost/image.gif";
                         //dir + "/images/cougar.jpg";
            MapPanel map = new MapPanel(url);
            getContentPane().add(map, "Center");
        public static void main(String[] args) {
            JApplet applet = new ZoomTesting();
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(applet);
            f.setSize(400,400);
            f.setLocation(200,200);
            applet.init();
            f.setVisible(true);
    class MapPanel extends JPanel implements MouseListener, MouseMotionListener {
        private BufferedImage image;
        private ArrayList<Point2D> points;
        private Point2D startingPoint;
        private int mouseX;
        private int mouseY;
        private AffineTransform xform;
        private AffineTransform inverse;
        RenderingHints hints;
        private double zoomFactor = 1;
        public MapPanel(String url) {
            super();
            try {
                image = ImageIO.read(new URL(url));
            } catch(Exception e) {
                System.out.println(e.getClass().getName() +
                                   " = " + e.getMessage());
            Map<RenderingHints.Key, Object> map =
                        new HashMap<RenderingHints.Key, Object>();
            map.put(RenderingHints.KEY_ANTIALIASING,
                    RenderingHints.VALUE_ANTIALIAS_ON);
            map.put(RenderingHints.KEY_RENDERING,
                    RenderingHints.VALUE_RENDER_QUALITY);
            hints = new RenderingHints(map);
            setTransforms();
            points = new ArrayList<Point2D>();
            startingPoint = new Point();
            addMouseListener(this);
            addMouseMotionListener(this);
        private void setTransforms() {
            Insets insets = getInsets();
            xform = AffineTransform.getTranslateInstance(insets.left, insets.top);
            xform.scale(zoomFactor,zoomFactor);
            try {
                inverse = xform.createInverse();
            } catch (NoninvertibleTransformException e) {
                System.out.println(e);
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2d = (Graphics2D)g;
            g2d.setRenderingHints(hints);
            g2d.drawRenderedImage(image, xform);
            if(!points.isEmpty()) {
                for(int i=0; i<points.size(); i++) {
                    if(i > 0)
                        drawLineSegment(g2d,points.get(i-1),points.get(i));
                    drawPoint(g2d, points.get(i));
            if(startingPoint != null) {
                drawTempLine(startingPoint, g2d);
            } else {
                mouseX = 0;
                mouseY = 0;
        private void drawPoint(Graphics2D g2d, Point2D p) {
            int x = (int)(p.getX() * zoomFactor);
            int y = (int)(p.getY() * zoomFactor);
            int w = (int)(13 * zoomFactor);
            int h = (int)(13 * zoomFactor);
            g2d.setColor(Color.ORANGE);
            g2d.setStroke(new BasicStroke(1.0F));
            g2d.fillOval(x - w / 2, y - h / 2, w, h);
            g2d.setColor(Color.BLACK);
            g2d.drawOval(x - w / 2, y - h / 2, w - 1, h - 1);
        private void drawLineSegment(Graphics2D g2d, Point2D p1, Point2D p2) {
            double x1 = p1.getX() * zoomFactor;
            double y1 = p1.getY() * zoomFactor;
            double x2 = p2.getX() * zoomFactor;
            double y2 = p2.getY() * zoomFactor;
            g2d.setColor(Color.RED);
            g2d.setStroke(new BasicStroke(3.0F));
            g2d.draw(new java.awt.geom.Line2D.Double(x1, y1, x2, y2));
        private void drawTempLine(Point2D p, Graphics2D g2d) {
            int startX = (int)(p.getX() * zoomFactor);
            int startY = (int)(p.getY() * zoomFactor);
            if(mouseX != 0 && mouseY != 0) {
                g2d.setColor(Color.RED);
                g2d.setStroke(new BasicStroke(2.0F));
                g2d.drawLine(startX, startY, mouseX, mouseY);
        public void mouseClicked(MouseEvent e) {}
        public void mouseDragged(MouseEvent e) {
            mouseX = (int)(e.getX()*zoomFactor);
            mouseY = (int)(e.getY()*zoomFactor);
            repaint();
        public void mousePressed(MouseEvent e) {
            if(e.getButton() == 1) {
                points.add(inverse.transform(e.getPoint(), null));
                if(points.size() > 0) {
                    startingPoint = points.get(points.size()-1);
                    mouseX = mouseY = 0;
            } else if(e.getButton() == 2) {
                zoomFactor = zoomFactor + .05;
                setTransforms();
            } else if(e.getButton() == 3) {
                zoomFactor = zoomFactor - .05;
                setTransforms();
            repaint();
        public void mouseReleased(MouseEvent e) {
            if(e.getButton() == 1) {
                points.add(inverse.transform(e.getPoint(), null));
            repaint();
        public void mouseEntered(MouseEvent mouseevent) {}
        public void mouseExited(MouseEvent mouseevent) {}
        public void mouseMoved(MouseEvent mouseevent) {}
    }

  • In the last 36 hours my photos have jumbled within various albums. Random photos have attached at the end of an unrelated album, old photos have appeared again on Recently Added, some photos are missing but still on "collections". No date order

    Within the last 36 hours my photo albums have turned into a real jumbled mess. Random photos have appeared at the bottom of my Recently Added album. In most cases it's a copy of a photo that was taken months or years ago so now it appears twice.. 200 random photos have appeared in an unrelated album.  Some photos are missing completely. The date order is correct in some places and then it goes back and forth over the months and years. The "collections" appears to be okay.  This morning when I went into the photo app About 50 photos that were permanently deleted 3 months ago reappeared on the Recently Added Album which  I deleted again.  if  I delete these irreplaceable photos from the unwanted album it will delete the photo completely. Help please - this is so annoying and frustrating. I hate to think when I turn the iPad on tmoor row what else will have changed .

    Quick Update:
    I usually have my Mac laptop up with Messages running on it.  As you know, it will receive the same messages you send/receive on your iPhone.  I thought all my old photos would be there too, but they have all disappeared as well except for the last few.
    Messages is supposed to archive all old photos to  a directory called ~/Library/Messages/Attachments.  On my mac, this was a 0 byte file that was created back in Jan 2014.  As a result, none of the old photos got saved on my Messages app either.  I looked at a Time Machine Backup and it has been the case since September (no earlier backups available).  So, it's unclear how long this issue has been going on for my Messages app and how related it is to my iPhone problem.
    In any case, if any of you use Messages, you may be able to recover your photos in that directory provided it didn't get trashed like mine did.  I moved the file and created a new Attachments directory.  Upon relaunch, Messages started properly storing new photos in there again.
    Either there was a really terrible bug in the Apple software or something malicious has happened.
    P.S.  I'm running OS 10.9.5 Mavericks.   There is a thread of people with this problem on Yosemite here:
    No pictures are shown in Message om Mac
    This seems like a pretty seriously terrible bug.  I will be talking again to AppleCare on Wednesday and I hope they can escalate this.

  • What is the fastest way to record and write image data?

    Hello,
    I am new to labview and am using the IMAQ software package to record and write data from a CCD camera to the hard drive. The end goal is a program that records and saves as much data as possible as quickly as possible, for experiments lasting on the scale of days. I have been experimenting with the snap, grab, and sequence methods of recording. To save the image data I was told by NI customer support that TDMS streaming would be the fastest method. I have also been experimenting with the TDMS VIs, however I have found the IMAQ Write File 2 VI to be faster in practice. Am I doing something wrong with the TDMS file structure? Is there a more efficient way to convert IMAQ image data to a dataform that can be written as TDMS? I am posting two of my programs to provide a clearer example of what I am trying to do. The first takes a snap of the image and appends it to a TDMS file. The second is the fastest I have found so far and uses Grab to record the images and the IMAQ Write File VI to save them. 
    Thanks
    Attachments:
    Camera Capture (Snap) and stream TDMS.vi ‏24 KB
    Camera Capture (Grab) and write image.vi ‏24 KB

    Hi
    For me it is no surprise that the second VI is faster then the first one, the reason is you can not compare this two VI with each other.
    In the first VI you work with TDMS files, in the second with png files. That would be much faster, because TDMS files need a lot of diskspace.
    Second point, why do you open, write and close for eacht iteration of the for loop a TDMS file in your first VI? That need really a lot of resources, so it coudn´t be fats as well.
    Save your converted pictures in one array, an after the acquisition you can save it in one TDMS file. When you need for each picture a TDMS file you have to know that this need some time to do this.
    So now for the architecture of your first VI, please look to the LL Sequence.vifrom the examples (C:\Program Files\National Instruments\LabVIEW 8.6\examples\IMAQ\IMAQ Low Level.llb\LL Sequence.vi), there you can see how an acquisition of a number of images have been to do.
    When you like it really fast, you make a producer/consumer architecture (see examples in LabVIEW for that).
    So in the first whileloop you acquire the images, write into a queue and in the second, parallel whileloop you read the queue and save the images. (see attachment)
    Hope that helps
    Kind regards
    Beat
    NI Germany
    Attachments:
    ProducerConsumerData.vi ‏10 KB
    ProducerConsumerData_LV8.5.vi ‏12 KB

Maybe you are looking for

  • Best approach for Data Modelling.

    Hello Experts I am building a Customer Scorecard involving SD and Marketing in BI 7.0. There are a couple of existing DSOs, some pushing the data into InfoCubes and some don't. All the reporting is happening from MultiProvider sitting on top of these

  • DB Apdater Polling in 11g does not update the polling the column

    I have simple SOA11g process in which we are polling a table using DB Adapter: 1) The polling column is process_flag and the read value is Y and unread value N. 2) I inserted the record in the table withe process flag as N. 3) The polling begins and

  • We wants Nokia 6233 new, latest phone software Upd...

    Hi my name is Faiz and m frm INDIA (Gujarat) I have nokia 6233 and my phone firmware version is 5.60. I want to download new, latest firmware version...after 5.60. not m only but all owners of nokia 6233 wants to download new Firmware version, B'coz

  • Error during New Version Creation in Controlling

    Hi I am creating new version in Controlling (tried copying from existing Versions too), and getting the given below error message. We are working on SAP R/3 4.7. Valuation in controlling area xxxx is inconsistent -> please check Message no. KT340 Dia

  • I have Lightroom 4 final version: I downloaded beta CS6 and it overwrote CS5 Photoshop in LR4

    1st. is my question in the wrong forum? If not, I downloaded beta vers. CS6 (yippeee) and it overwrote PS CS5 in LR only. Yes, I still have CS5 on my computer, it didnt overwrite it. Can you please tell me how to bring PS CS5 back into LR4? Thanks ev