Method to double a picture size and change to grayscale

Hello, I'm having trouble figuring out whats wrong with my code. Its supposed to double to size of a picture and change it to grayscale, but when I call it I only get a double sized blank picture. I can't figure out how to get the picture itself to copy over when I call the method. Here is my code:
public Picture componentLayout()
   Picture targetPic = new Picture(2 * this.getWidth(), 2 * this.getHeight());
   Pixel[] pixelArray = this.getPixels();
   Pixel pixel = null;
   int intensity = 0;
   // loop through all the pixels
   for (int i = 0; i < pixelArray.length; i++)
     // get the current pixel
     pixel = pixelArray;
// compute the intensity of the pixel (average value)
intensity = (int) ((pixel.getRed() + pixel.getGreen() +
pixel.getBlue()) / 3);
// set the pixel color to the new color
pixel.setColor(new Color(intensity,intensity,intensity));
return targetPic;

Althought I'm not familiar with the Picture class, i do notice that your line:
Picture targetPic = new Picture(2 * this.getWidth(), 2 * this.getHeight());constructs a new instance of Picture, which is then never used until
return targetPic;therefor it is constructed, and returned in it's initial state, without ever being mutated.

Similar Messages

  • How do I increase the point size and change the font for the windows and boxes on Maverick such as the tiny print on the email inbox list of messages.  Can increase size on the actual message but not on the list of messages.

    How do I increase the point size in the dialog boxes and especially on the list of messages on email?  I can increase the point size and font of actual messages content but not the LIST of emails in my inbox.  They are too small for me to read.

    This discussion is for computer built before 2006.
    You could use a different mail app.  Consider thunderbird.
    It can be hard to find with community ( forum ) to post to. Here is an easy and complete list:
    https://discussions.apple.com/community
    I'll ask the host to move this post to M.
    Robert

  • Estimate db size and change tablespace configuration before restoring RMAN

    Hi,
    I am wondering whether it is possible to estimate the size of the restored database just from the RMAN files I have?
    Also, Is there a setting I can change in these files to disable 'autoextend' feature in the tablespace of the restored database?
    thank you in advance.

    Hi
    But using this method I will damage the existing control file of the original server.
    SQL 'alter database mount';
    sql statement: alter database mount
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03009: failure of sql command on default channel at 09/16/2009 17:18:59
    RMAN-11003: failure during parse/execution of SQL statement: alter database mount
    ORA-01103: database name 'OLD_DB' in control file is not 'JUPITER'
    And when I start JUPITER:
    startupORACLE instance started.
    Total System Global Area 192937984 bytes
    Fixed Size 2169752 bytes
    Variable Size 134079592 bytes
    Database Buffers 54525952 bytes
    Redo Buffers 2162688 bytes
    ORA-00205: error in identifying control file, check alert log for more info
    Is there a way to restore the control file without damaging the existing server?
    thank you for your support.

  • Desk top pictures delete and change

    I have two duplicate pictures, get rid on one of each
    and add others from the picture folder in iPhoto
    keep trying but no go
    got this about a month ago
    kept away from computers for a long time -- burnout
    first dealt with them in 68 -- IBM 1401 and IBM360
    anyone program in algol any more??

    I am back. On Windows 7 computers start up screen there are there are three major items blue icon , sign in box and red icon. The blue icon you want to click on that. Go down the list of helpers check mark magnifier then click apply and click ok. You can adjust the magnifier to any size you whant by clicking it and draging it. Now the red icon is your computers shut down options. The magnifier will appear every time you turn on your computer. You are all set now. You can also check mark to make things easier to read and ajust your computer to your own eyes.

  • Desktop Icon Picture size and format limit

    I'm pushing out a group policy to desktop but would like to know icon size limits and also what are acceptable formats. Currently using a 12k jpg icon that points to a URL and testing but don't get the picture.
    Setting is located:
    User configuration\preferences\windows settings\shortcuts\Icon file path

    Hi,
    >>Currently using a 12k jpg icon that points to a URL and testing but don't get the picture.
    Before going further, we can run command gpresult/h gpreport.html
    to check group policy result report to see if the policy setting got applied successfully. Besides, please make sure that users can successfully access the icon file. We can also check event logs in Event Viewer to see if some related events were logged.
    If we can't find anything wrong with above troubleshooting, we can use another icon to check if this is related to the icon itself.
    TechNet Subscriber Support
    If you are TechNet Subscription user and have any feedback on our support quality, please send your feedback here.
    Best regards
    Frank Shen

  • Hi Picture size and durations

    Hi
    Two problems. Pictures inported are from my camera fro animation sequence but they do not fit into the imovie window - about a third is cut off the bottom. Is there a way for imovie to resize them on import? or do I need to resixe them all manually?
    Next problem asked before and thought it was fixed but no longer!
    Imported photos to timeline adopt a duration of 9:25 seconds tried selecting all and chainging photo info but in;y applries mew duration to the last on.
    Tried to alter the first and then import the others this doesn't work either-it defaults to 9,25 seconds again.
    Any ideas how I can fix this?
    Thanks

    Pls bear with me. First time using this forum. I'm new to iMovie, but making progress. I can't bring in still clips without chopping large areas of the image. Tried resizing in PS Elements. Tried bringing in directly from iPhoto. This problem is a show stopper for me. Any suggestions would be appreciated.
    Pat Malone

  • Change page size and get error on Booklet. Why?! Only in CS6...

    Why when we are working with a material of many pages, and all pages have the same measure, and alter the size of each page (in File -> Document Setup), we can no longer generate booklets? I was tested in version CS5 and it worked perfectly in version CS6 gives error:
    "The active document uses multiple pages sizes. Booklet Print works only with documents That use consistent page size."
    I've checked all pages and it all have identical size between them.
    Take a test.
    Open a new file with multiple pages. Try to create a booklet. Will function properly. After this, go to File -> Size and change the page size of the pages. Now try to create a booklet. Will give error.
    I tested in a couple of macs...

    Well I am having this exact issue.
    I have seen many posts in other areas of this discussion and online elsewhere. As it goes, Adobe is going to get sued for this.
    I paid for a working feature of the software in CS6. Simply releasing a new version and forcing the user to pay for a fix to a problem in an old version is not lawful business. It's extorsion. They did not uphold their end of the bargain on the contract of me paying for a working product.
    The owness is on them now to fix the bugs in the current versions of broken software.

  • Can we change font size and font type in reports

    Hi All Technical/Functional Masters,
    We are developing some transactional reports in ISU. this report has 20 columns to be printed. On screen, display is not a problem but client has a requirement to download this report in PDF format and wants to print on A4-paper in Landscape. Although we have managed to accommodate all the columns on A4 paper but have to compromise with font size that are very small and not visible. If we download the report in excel format we are able to maintain the font size 8 and accommodate all columns after little format but same in PDF is a problem.
    Can anyone tell whether we can increase the font size and change font type(from SAP standard to 'Arial') before sending the output in PDF ? Is there any property or utility that can be changed or used for this purpose.

    Function Module : CONVERT_ABAPSPOOLJOB_2_PDF
    Include : THSTXWFPL
      for modify font size
    decrease fontsze foncharacter will increase
    fontsize = 120.     <-- Change
    fontsize = 100.  or fontsize = 80
    Depend on your logon lang. My case logon 'TH' or 2.  I modified font ZCORDIA (refer CordiaNEW thai font)
    if is_cascading is initial.
      case language.
      when '0'. "Serbian
        font = 'COURCYR'.  devtype = 'SAPWIN'.
      when '1'. "simpl.Chinese
        font = 'CNHEI'.    devtype = 'CNSAPWIN'. cjklang = 'X'.
      when '2'. "Thai
      font = 'THDRAFT'.  devtype = 'THPDF'.
       font = 'ZCORDIA'.  devtype = 'ZMTHSWNU'.
        font = 'THANGSAN'.  devtype = 'ZPDFUC'.
      when '3'. "Korean
        font = 'KPSAMMUL'. devtype = 'KPSAPWIN'. cjklang = 'X'.
      when '4'. "Romanian
        font = 'COURIER'.  devtype = 'I2SWIN'.
      when '5'. "Slovenian
        font = 'COURIER'.  devtype = 'I2SWIN'.
      when '6'. "Croatian
        font = 'COURIER'.  devtype = 'I2SWIN'.
      when '8'. "Ukranian
        font = 'COURCYR'.  devtype = 'SAPWIN'.
    Add font Cordia Thai
    SE73 --> Fon familia --> ZCORDIA
    Load Font Cordia thai to system
    SE38 --> RSTXPDF2UC
    load CORDIA.TTF
    SE73 --> printer font --> 'ZMTHSWNU'
    Add ZCORDIA font and copy AFM Metric from = 'THDRAFT'.  devtype = 'THPDF'.
    Modify AFM
    example
    *----- OLD--
    StartFontMetrics 2.0
    sapFamily ZCORDIA
    sapHeight 000
    sapBold false
    sapItalic false
    StartCharMetrics 0183
    WX 0500 ; N space                          ;
    WX 0500 ; N exclam                         ;
    WX 0500 ; N quotedbl                       ;
    WX 0500 ; N numbersign                     ;
    WX 0500 ; N dollar                         ;
    WX 0500 ; N percent                        ;
    WX 0500 ; N ampersand                      ;
    *--NEW--
    StartFontMetrics 2.0
    sapFamily ZCORDIA
    sapHeight 000
    sapBold false
    sapItalic false
    StartCharMetrics 0183
    WX 0375 ; N space                          ;
    WX 0375 ; N exclam                         ;
    WX 0375 ; N quotedbl                       ;
    WX 0375 ; N numbersign                     ;
    WX 0375 ; N dollar                         ;
    WX 0375 ; N percent                        ;
    WX 0375 ; N ampersand                      ;
    Result : decrease space between character.   Then Your PDF will have BIGGER FONT.
    Rdgs,
    Suwatchai

  • Is there a method in labviewto dynamically save and change the monitor resolution under program control?

    Is there a method in labview to dynamically save and change the monitor resolution under program control? I have another application that runs on another monitor. I would like to change the monitor resoultion to 640x480 on program startup, and then restore the monitor resolution back to the user's settings on exit. Can this be done?

    vaidehi_joshi wrote:
    Is there a method in labview to dynamically save and change the monitor resolution under program control? I have another application that runs on another monitor. I would like to change the monitor resoultion to 640x480 on program startup, and then restore the monitor resolution back to the user's settings on exit. Can this be done?
    Have you already done this manually?  I've seen Labview scale front panels very strangely when changing resolutions...
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Reduce image size and print it out?

    I scanned an image (coloring on a postcard). This size is too big to fit into a 'album' picture in MS Picture It! All I want to do is REDUCE the image and save it so that it will fit into the computer photo album I'm creating.
    I've tried Image/Resize/Image Size and changed the sizing, but it still comes out the exact same size as the original. What am I doing wrong?

    > I want to REDUCE the image, not enlarge it.
    I understood that - what makes you think I didn't?
    > It's 948x645 pixels. I just want the image about an inch (respectively) smaller
    You can't think in terms of inches for screen images. You have to work in pixels and the actual size will depend upon the screen resolution on the machine being used to view the image.
    I'd reduce the pixel size by about 80 to get the effect that you want. Use Image/Resize/Image Size and make sure that you have "Resample" checked.

  • Thank you for approving my feed iTunes . The only problem is, there is no art work, even though artwork was submitted correct sizes and formats were used. Why is this and how can the problem be rectified?

    Thank you for approving my feed iTunes . The only problem is, there is no art work, even though artwork was submitted correct sizes and formats were used. Why is this and how can the problem be rectified?

    Thanks for getting back. Hadn't got round to re uploading the amended feed. I just did it now.
    The only thing is, Feed Validator doesn't like it because of the picture size, and a couple of other things, it reeds the following:
    Sorry
    This feed does not validate.
    line 22, column 14: width must be between 1 and 144: 1400 [help] <width>1400</width>
                  ^
    line 23, column 15: height must be between 1 and 400: 1400 [help] <height>1400</height>
                   ^
    line 25, column 21: XML parsing error: <unknown>:25:21: not well-formed (invalid token) [help]
    <itunes:image href=http://www.whiteberg.com/Wdotfontitunes2.png" />
                         ^
    In addition, interoperability with the widest range of feed readers could be improved by implementing the following recommendations.
    Your feed appears to be encoded as "utf-8", but your server is reporting "US-ASCII" [help]
    line 4, column 114: Self reference doesn't match document location [help]... dcast.xml" type="application/rss+xml" />
                                                 ^

  • Type size and property presets?

    I ran across a video or article a while back and can't seem to find.  Here is what I'm trying to accomplish and maybe some tips/links from the Forum can help this fron-end designer out!
    building site pages via Photoshop for markup development, it sucks having to always pull down the font drop-down and select the font, tab to the size and change, kerning, etc.....
    Is their a "most used" or "presets" for composition.  Also if their maybe any other "web design" specific little hidden gems like that in CS6, I'm all ears.
    thanks for any help!!

    You need Style ;-)
    http://psd.tutsplus.com/tutorials/tutorials-effects/paragraph-and-character-styles-photosh op-cs6/

  • JPEG size and image losses in Flash CS3

    I am creating a website for a wedding and using the photos of the couple on the website.  I created designs in Photoshop CS3 with the following settings:
    Document Size: 6.25" x 8.25" or 1875p x 2475p @ 300pixels/inch
    To use the image in flash, I used "Save As" in photoshop to convert image into JPEG with "Quality 10 Maximum" setting.
    I created a Flash CS3 document with the following settings:
    Document Size: 6.25" x 8.25" or 494 x 550 pixels
    I imported the JPEG image from photoshop into flash and came in an image much larger than 6.25"x8.25".  I resized the image in flash with constrained dimensions to 494x550 pixels and it the text shadows and glow lost its clarity.
    TRIAL 1
    Obviously something was wrong.  So, I went back to Photoshop and used the save for web/devices option and saved it as a high quality JPEG.  Same result.
    TRIAL 2
    This time, I tried a different trick in Photoshop.  I went to Image->Image Size and changed the image resolution to 150pixels/inch and used "Save As" again.  I imported it again to Flash and now the image was too small.
    How do I match the image "save as" from photoshop to the flash document size so that I dont lose resolution?  I used Zoomify in photoshop successfully without losses.  Why is it not possible to just import an image to look the same way a JPEG file appears?

    Hi,
    screen resolution is 72. So if you save your jpg at 72 with the desired size in pixels, the image will appear just fine inside flash, but, two things to keep in mind:
    -What counts is size in pixels. Resolution only matters when you go printing (where the rate between inches and pixels is needed). For web you have to watch the size in pixels only. Even if resolution is different from 72, if you scale the image to the original size in pixels it will be displayed well in the flash movie (if the movie itself isn't scaled neither)
    And, it isn't the exactly same to import to scenary that to import to library. When you import to scenary (ctrl+r) sometimes flash resize the object, so maybe you get some distorsion in jpg files. Going to transform panel or in property inspector panel you can set the image size to 100 percent again. When you import to library you have to drag the image into the stage, and then the image will appear at 100%.
    i hope this helps,
    Jorge

  • In putting together a book I can move photos onto a page and enlarge the picture but is there a way to reduce the picture size? some cases I want a smaller picture and if I change the size of the picture box I only get a portion of the image. I wnt to red

    picture size...in putting together a book I can move photos onto a page and enlarge the picture but is there a way to reduce the picture size? some cases I want a smaller picture and if I change the size of the picture box I only get a portion of the image. I want to reduce the image to fit the size of the box.

    If you right click on the image on the page in the context menu select photo box alignment and then select one of scale to fit {centered, Left-aligned, Right-aligned}
    That should do what you are loking for.

  • I am using your software: CS^ InDesign Suite on a PC using a Windows 7 operating system.     Due to eyesight issues, I need to have the menu bars of programs in easy-to-read font and picture size.  Specifically, the menu bar

    Hi,
    I am using your software: CS6 InDesign Suiteon a PC using a Windows 7 operating system.
    Due to eyesight issues, I need to have the menu bars of programs in easy-to-read font and picture size.  Specifically, the menu bar across the top (File, Edit, View, etc.), and the menu bar on the left side with the graphic depiction of options.
    In earlier versions of Windows (e.g. XP), whenever I changed the screen resolution on my computer to a lesser resolution in order to show the link icons on my desktop in a larger, more readable size, all the software programs, including yours, appeared on my screen with the menu bars in the larger font size that I needed.
    However, in Windows 7, this is not the case.  Even though I have selected the lowest resolution, making the icons on my desktop extremely large, I cannot read the options across the top menu bar of your program, nor the pull-down menu items that they contain.  I cannot see the graphic depictions of options on the left side of the screen. They are all too small.  How can I make your program increase the size?

    CS6 is not high-DPI compatible/ enabled and that can't be changed. If you cannot6 make it work with your operating system means, then short of joining Creative Cloud and using newer versions there is nothing you can do.
    Mylenium

Maybe you are looking for

  • Problem on DELETE CASCADE

    my following tables not allow me to delete the parent table student and the corperate recode in child table also get delete , why create table Student(       student_id  int(10) not null  ,       sure_name VARCHAR(25)  not null,       english_name Va

  • Dreamweaver CC 2014 - Mac OSX 10.8.5 - Il programma gira molto lentamente

    Dreamweaver CC 2014 - Mac OSX 10.8.5 - Il programma gira molto lentamente, tale da non riuscire a lavorare. Prove già eseguite: - 1) Disinstallato e reinstallato il programma, ma il problema persiste. - 2) Disinstallato per sicurezza Dreamweaver CC (

  • Clone the Forms and Report services standalone server

    I want to clone Forms and Report services standalone server, Is there any easy step by step instruction doc available??

  • Form Generator Error CGFK$QRY_

    Hello, I' m new using Designer i've tried to generate a module using 10g Form Generator, but i always stop at this error: Compiling procedure CGFK$QRY_UTILIZADOR_UTL_PER_FK... Compilation error on procedure CGFK$QRY_UTILIZADOR_UTL_PER_FK: PL/SQL ERRO

  • Price Difference In Bill From Edge To 3g

    Does anyone know how much the monthly bill goes up when you upgrade form Edge to 3G? My friends all claim it's only $5 more a month but I could have sworn the AT&T rep told me it was $20 more. Anyone have any insight? I know everyone's phone plan is