Canvas programming!!

I am using game canvas .. on which i am displaying words,, but i want before displaying new word old word should be erased , and new word should take same position as old word.. Can any one please tell me how do i do this? Thanks.

Hey its simple...
public void modifyWord()
  word = newWord;
public void paint(Graphics g)
  g.setColor(0,0,0);
  g.fillRect(getWidth(),getHeight());
  g.setColor(255,255,255);
  g.drawString(word,50,50,g.TOP|g.LEFT);
}other repaint and modifying word logic same...
-@rjun

Similar Messages

  • CANVAS program at Univ of Mary Washington- since 15 September am unable to upload documents via my Mac using Firefox 3.6.23, Mac OS X.4.11. Can you help?

    Canvas is the replacement for Blackboard program for posting study material, group conferencing and messaging to students. Until about 15 September, I was able to upload DOC documents to a Files site for students to read as extra assigned material. On or about that date, I have been blocked from doing that. When I go to upload a document, it starts and then says UPLOAD ERROR. I can still upload if I send the DOC document to a PC computer as an e-mail attachment and then upload it on the PC. The following are the specs of my computer:
    I-Mac Processor PC G4
    Memory 512 SDRAM
    OS X.4.11
    Remaining memory on HD approx 30 Gegs
    Firefox browser my standard) 3.6.23
    Like I say, I was able to use canvas fully until around that date. From our IT Dept, I understand that Canvas works with Firefox 3.5 and above. Can you help me?
    Thank you,
    Chalmers Hood

    Canvas is the replacement for Blackboard program for posting study material, group conferencing and messaging to students. Until about 15 September, I was able to upload DOC documents to a Files site for students to read as extra assigned material. On or about that date, I have been blocked from doing that. When I go to upload a document, it starts and then says UPLOAD ERROR. I can still upload if I send the DOC document to a PC computer as an e-mail attachment and then upload it on the PC. The following are the specs of my computer:
    I-Mac Processor PC G4
    Memory 512 SDRAM
    OS X.4.11
    Remaining memory on HD approx 30 Gegs
    Firefox browser my standard) 3.6.23
    Like I say, I was able to use canvas fully until around that date. From our IT Dept, I understand that Canvas works with Firefox 3.5 and above. Can you help me?
    Thank you,
    Chalmers Hood

  • Corrupt Canvas

    Is there any way I can save my canvas without deleting and recreating it? The problem is that I have three canvases. One is content and the others are stacked. Some how I got the first stacked canvas setting on top of the content canvas. I cannot see my first canvas in navigator unless I delete my first stacked canvas. If I changed the first stacked canvas to content then it goes away. I have tied to delete and copy the same canvas from another form that has no stacked canvas. I still get the same results. I don't know how this happened but it is causing others problems with my processing. I guess I don't understand stacked canvases. I was told that if I touch a data block I must continue until something is clear or a go_item is issued for another item in another canvas. If I have an item that is in one block and that item is used to process data in a different block and canvas that I can use a control_block to passed data. What is the proper way to handle stacked canvases? If I have items that are processed in the first block but are shown on the stacked canvas would I need to move those items to the next block or just assigned the values to the control_block and continue processing tried to keep the data blocks and canvases separate but I couldn't get them to display.
    I fixed my previous problem but it cause another problem with my previous processing.
    I think that if i could fixed the content canvas that my problem might go away. I would appreciate any help.
    :-{                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Steve,
    The stacked canvas is horizontally the same but vertically smaller Have you every seen a stacked canvas on top of the content one? I tried to go into the canvas and highlight the stacked canvas to delete it. It will not allow me to delete it. It appears that it is attached to the content one. I don't know how this happen I need to see the top portion of my content canvas when I am processing items on the stacked canvas. Something like this.
    Based on what command I entered, the content canvas displays either with or without
    the stacked canvas.
    program:_________
    Command:________ content canvas
    ac_seg:_____
    WO_NBr_____ stacked canvas
    Repair______
    proces clear
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    print clear
    It Navigator this is what my content canvas looks like.
    However, the stacked canvas looks like this;
    ac_seg:_____
    WO_NBr_____ stacked canvas
    Repair______
    proces clear
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    print clear
    So the content canvas doesn't suppose to show the stacked canvas on top of
    the content canvas in Navigator.
    I appreciate any suggestions to fixing my problem.
    Kimosabe

  • FR: Ability to move entire Motion Path (as in After Effects)

    If you like this Feature Request, please copy/paste on Adobe's Feature Request page to get your voice heard: www.adobe.com/go/wish
    *******Enhancement / FMR*********
    Brief title for your desired feature: Ability to move entire Motion Path (as in AE)
    How would you like the feature to work?
    The same way it currently works in After Effects: ability to move an entire motion path by selecting all of the motion path's keyframes before click-moving one of the selected keyframes in the Canvas/Program Monitor.
    Why is this feature important to you?
    This feature makes it so much more efficient to move a motion-animated asset to a new location without inadvertently changing the motion path.  This tremendous workflow efficiency works wonders in AE and could work equally well in Premiere Pro.

    When previewing, make sure that you're using RAM preview to get real-time playback:
    http://helpx.adobe.com/after-effects/using/previewing.html#use_ram_preview_to_play_video_a nd_audio
    See this regarding the issue with your output file stuttering:
    http://forums.adobe.com/thread/684381
    Most important, start here to learn the basics:
    http://adobe.ly/AE_basics

  • Adobe Director

    hi,
    I have a canvas program made in adobe director. I got it form
    Internet.
    It is working coolly. Anyone can draw simplefigures with
    colors with it.
    I need to add one new functionality . I want the canvas
    content can be saved as jpg
    format picture. How to do this !!!!!!!!!

    Buubai wrote:
    > Everything is working perfectly fine now. But the
    problem is when I publish it
    > the save button is not working.I want to publish it in
    web , how to do it ?
    Hi Buubai,
    The Sharp Image Export Xtra is not Shockwave Safe, which
    basically menas it does
    not work in online situations.
    The DirectImage Xtra does image exporting and is Shockwave
    safe. It is at:
    http://www.directxtras.com/DImage_home.asp?UUID=1718063
    but it's not free - costs $199
    RavImageExport Xtra
    http://www.cxtra.net/site4/modules.php?name=Content&pa=showpage&pid=61
    $169.99. Is Shockwave Safe
    cXtraGraphicIO Xtra
    http://www.cxtra.net/site4/modules.php?name=Content&pa=showpage&pid=61
    50 Euro. Not sure if it's Shockwave Safe.
    regards
    Dean
    Director Lecturer / Consultant
    http://www.fbe.unsw.edu.au/learning/director
    http://www.multimediacreative.com.au

  • BlackMagic Decklink Mini Monitor - how to output Source signal?

    Dear PrP users,
    I currently purchased a Blackmagic Decklink Mini Monitor video I/O to use with PP CC and SG CC as well as Da Vinci Resolve 9/10 once I move onto it; nothing too fancy which I'm fine with the kind of grading work I do. I did this so I could have a maximum of 4 computer monitors whilst I grade on my GPU then the additional output for the Director/Client.
    However I did not know upon purchase that it only outputs the Canvas/Timeline (Program) from Premiere Pro. Before I would have my big TV output not only the Canvas (Program) but also the Viewer (Source) so I could show the Director/Client a clip from the browser without having to drop it into the timeline. This was a super useful feature and I am hoping to use this to Decklink Mini Monitor through premiere pro (as that is what I do primarily) that will both do Source and Program signals from PP CC. Is there a way to do that? Can it be done?
    I will of course go on BlackMagic forums also to find out, but thought I'd try here also just incase.
    Thank you.

    You're right, I can output the Source monitor too however it will only output 1080p (I found this out my playing ProRes 1080p through the Source). The material I'm working with is r3d 4k, of which I am working in a 1080p timeline (down scaled and down sampled) which outputs the Program to the Blackmagic DeckLink just fine, when I try to put the same material in a 4k timeline it refuses to play it. Thus, the Browser and conversely the Source monitor has no choice but to output the r3d 4k in its native resolution (unless there is a way to non-destructively output the r3d 4k Source as 1080p also)?
    Any solutions? Is it the video card itself (its BlackMagic cheapest model) which limited to 1080p or the TV itself I'm using?
    Thank you for your advice.

  • If you could add one feature to Eloqua what would it be?

    What is one feature/function that you would add to Eloqua? How would it help you reach your goals?

    SPACES - Separate, configurable "SPACES" for different geo regions / product groupings that could be globally managed. You could assign the space templates, segments, etc. This would give the regional teams flexibility to deliver marketing objectives based on global standards and guidance. This is HUGE. The current permission model is too clunky and opaque.
    TEMPLATES - Real email/landing pages templates that are easy to design/setup and deploy to the SPACES, (see 1). We've crashed several times trying to get templates to work over the years.
    INTEGRATED REPORTING: Reporting that can used in guiding automation, like we had in E9. Basically, more integrated reporting!
    FUNNELS - Everything we do as marketers (at least everything I do) is based on funnel progression, there should be an centralized interface/setup that would be the heart of triggering automation, etc that is based on funnels. Think of the lead scoring interface, but now replace it with one or many funnels with stages.
    CANVAS & PROGRAMS - They should be one interface, with the "campaign canvas" bits just one aspect of a broader program
    FILE MANAGEMENT - Needs to be the same as an operating system. 'Nuff said. This includes ability to SAVE AS... at the asset level.
    LISTS - Ability to easily move contacts from list to list. No more having to export a spreadsheet link to an email. This is killing my day.
    I could go on for days.

  • Is it possible to have an Infinite canvas drawing program

    Hi
    Is it possible to have an Infinite canvas in a drawing program?
    The sort of Features that make sense would be
    Zoom In and out
    All other basic drawing tool capabilities

    That's not right, hereafter. So long as the canvas is virtualized it can be theoretically infinite. It only needs memory and disk space for the sections actually displayed.
    Major Solutions, there are low level facilities to enable what you describe, but you'd need to implement the details (in particular the drawing tools) yourself. As hereafter notes there are some practical issues depending on your definition of infinite.
    For very large canvases take a look at Direct2D and the VirtualSurfaceImageSource.
    --Rob

  • Program doesnt respont when i add canvas on enterFrame function

    Hello all!
    I have been making a simple aplication and i have a problem i cannot find the solution (neither why it is happening)
    The thing i want to do is to dynamically add a canvas containing a button to the application and then i want the canvas to be moved from the left side of screen to the right.
    So i have made the following code
    And it works just fine.
    The next step is instead of using the Canvas i use a custom canvas ..
    here is the CustomCanvas.mxml component
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300">
         <mx:Button label="ccccButton" />
    </mx:Canvas>
    then i change the following code line
          var ccanvas:Canvas = new Canvas()  
              to
          var ccanvas:CustomCanvas = new CustomCanvas();
    the result is that there is no canvas displayed at the screen...the program doesn't do anything....
    the most weird thing is that if i do not have an onEnterFrame function and i just add my custom canvas to the init() method it is been displayed properly. Even if i have an onEnterFrame but without changing the customCanvas's x value it is been displayed properly. But the moment i write in the
    onEnterFunction the code  ccanvas.x +=1 the program doesnt display anything.... But if i do that with the original  Canvas object it is all ok,,,
    What is happening here? how i can i make a custom canvas object and then be able to move it in a onEnterFrame method?
    Thank you!!!!!!
    PS...what is the tags for putting code in?  i used the plain tag ..i hope it can be readable

    Unfortunately I dont know how to put a break point at that class which I have not write.
    I made a similar code example :
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
         <mx:Script>
              <![CDATA[
                   import mx.controls.Button;
                   import mx.containers.Canvas;
         //          var testCanvas1:Canvas = new Canvas();
                   var testCanvas1:CustomCanvas = new CustomCanvas()
                   public function init():void{
                        testCanvas1.addChild(new Button());
                        addEventListener(Event.ENTER_FRAME,onEnterFrame);
                        addChild(testCanvas1);
                   public function onEnterFrame(event:Event):void{
                        testCanvas1.x += 1;
              ]]>
         </mx:Script>
    </mx:Application>
    As far as i have tried when instead of canvas i put the custom cunvas the program does not run. So the next step i did; is to remove the
    <mx:Button id="ccccButton"/ > from the custom canvas file . And by suprise it works...
    i tried adding again differnet kinds of mxml component to the the custom  canvas file  and after i added something it stopped work.
    But if i have a custom canvas and i add whatever i want to it to the main application with the customCanvas.addChild() method it works fine,,,,
    is that observation of any help?

  • Reopened a multiclip session and 'Program' shows in both Viewer & Canvas ??

    Hi Fellow FCPittes, __ ( FCP v5.0.4 on the Q/S dual cpu )
    I worked on a small 2 camera multiclip yesterday just fine, but when I opened it today the multiclip loaded immediately into the Viewer, which in itself is strange, and I now have the 'Program' video in both Viewer and Canvas.
    When I try to continue editing, as soon as I run it (spacebar in either timeline or Canvas) the 2 camera multiclip in the Viewer disappears and changes to the program video and I can't see the multiclip angles. As soon as I stop, they show up again.
    I tried an autosaved version, but it's too far back to be of use (had it set to a/s every 50mins - shortened it now) and I've also tried shutting down and reloading.
    If I do a modification to a section, say remove a couple of clips and stretch out a clip, the normal multiclip function returns fine, JUST for that modified area, but returns to the above in the sections not modified...
    Tough one, I know - but maybe 'you' have had this problem and know the fix...
    Thanx...
    Nick. . .

    Well, there may be some settings to check -
    It is possible, and usually desirable to get the viewer to play in sync with the timeline for mutlitclip editing by choosing "open" from the sync dropdown in the viewer. However, you usually have to open the multiclip from the timeline to the viewer first, and then change the sync setting each time you open something new into the viewer.
    It should not be possible to open the sequence into the viewer and the timeline/canvas at the same time.
    Check the view dropdown in the viewer and make sure it isn't set to Multiclip - 1-up, which would show you only the currently active angle of the multiclip.
    If all else fails, trash prefs.

  • Can anyone tell me why a picture would change color when I try to download/upload it?  It is the exact same picture- chosen the same way and when it goes to any other program it changes the color (I've tried canvas on demand and mpixpro.  I've also tried

    Can anyone tell me why this picture changes color when I try to download/upload it?  It is the exact same picture I have taken from the same location.  The image on the left is via preview and the image on the right is what is shows like when I try to download it.  I have emailed it to myself and it shows fine on the computer and in CS4, but when I look at the download via my phone or on another computer it shows the wonky color on the right.  I have checked the color space shows RGB/8 bit.  Any ideas why or how to fix it?  It isn't with any one specific session.... and I've tried it on both my desktop and my laptop- saved image to an external hard drive and to drop box.  I've tried sending the image to canvas on demand, my email, mpxipro, POST editing- all the same result.  Please HELP!!  What am I doing wrong?

    Most of the time you see something like that. The image in question has a color profile other then sRGB. Some image viewers/displayers are color managed and others are not.  So the image do not look the same in all of the applications you use. So colors seem to change.
    Try converting it to sRGB color and see if then looks the same all around. Also I think PC and Mac displays are set to different gamma something like 1.8 and 2.2
    Though I'm colorblind I even see color variations.

  • Program error when try to use 3D repousse in Photoshop CS5 extended?

    Please help!!!! Unable to use 3D repousse Photoshop CS5 Extended  (my system info is described below)
    I tried almost everything that is available in Adobe library help, also re-installed programs as requested by Adobe support (suspected to get rid of me), it did not solve the problem.
    I used to have 3D capabilities, and also crop tool worked well before (now it changes all layers when using crop even in background).  My PC is same,  nor I downloaded plugins or changed video cards (these things are too advanced for me!), also restored preferences many times.
    My system makes automatic updates, reviewed graphics and adobe as recommended.
    OpenGL settings is odd …only can access basic, other modes are not highlighted (normal or advanced).
    ERRORS (for 3D Text)    
    1-“Your 3D scene now exceeds the limits of lights and/or textures for the video card’s hardware-accelerated 3D rendering. As long as the limits are exceeded, 3D rendering will be done in software only, and some features (e.g Repousse)will be disabled.”
    2- “Your video card does not meet the requirements for hardware-accelerated 3D rendering. All 3D will be rendered with software only “
    3-“ Could no complete the text layer command because of a program error”
    ERROR (for object)
    Open GL/GPU HARDWARE ACCELERATION IS CURRENTLY  DISABLED. 3D WILL NOW BE RENDERED WITH SOFTWARE ONLY.  TO ENABLE OPEN/GL  ACCELERATION, GO TO PREFERENCES > PERFORMANCE TAB AND CHECK THE “ENABLE OPENGL GRAWING” CHECK BOX.
    Is it possible that I have a GPU Sniffer? all these terms I have learned recently =)   but I have a healthy & capable graphic card and accepted by adobe standards.
    SYSTEM INFO 
    Adobe Photoshop Version: 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch]) x64
    Operating System: Windows 7 64-bit
    Version: 6.1 Service Pack 1
    System architecture: Intel CPU Family:6, Model:5, Stepping:2 with MMX, SSE Integer, SSE FP, SSE2, SSE3, SSE4.1, SSE4.2
    Physical processor count: 4
    Processor speed: 2128 MHz
    Built-in memory: 3895 MB
    Free memory: 2210 MB
    Memory available to Photoshop: 3280 MB
    Memory used by Photoshop: 70 %
    Image tile size: 128K
    Image cache levels: 4
    OpenGL Drawing: Enabled.
    OpenGL Drawing Mode: Basic
    OpenGL Allow Normal Mode: True.
    OpenGL Allow Advanced Mode: False.
    OpenGL Crash File: Not Detected.
    OpenGL Allow Old GPUs: Not Detected.
    Video Card Vendor: Intel
    Video Card Renderer: Intel(R) Graphics Media Accelerator HD
    Display: 1
    Display Bounds:=  top: 0, left: 0, bottom: 768, right: 1360
    Video Card Number: 1
    Video Card: Intel(R) Graphics Media Accelerator HD
    Driver Version: 8.15.10.1968
    Driver Date: 20091008000000.000000-000
    Video Card Driver: igdumd64.dll,igd10umd64.dll,igdumdx32,igd10umd32
    Video Mode: 1360 x 768 x 4294967296 colors
    Video Card Caption: Intel(R) Graphics Media Accelerator HD
    Video Card Memory: 1723 MB
    Serial number: 
    Application folder: C:\Program Files\Adobe\Adobe Photoshop CS5.1 (64 Bit)\
    Temporary file path: C:\Users\Patricia\AppData\Local\Temp\
    Photoshop scratch has async I/O enabled
    Scratch volume(s):
      C:\, 284.6G, 218.5G free
    Primary Plug-ins folder: C:\Program Files\Adobe\Adobe Photoshop CS5.1 (64 Bit)\Plug-ins\
    Additional Plug-ins folder: not set
    Installed components:
       A3DLIBS.dll   A3DLIB Dynamic Link Library   9.2.0.112
       ACE.dll   ACE 2010/12/13-23:37:10   64.449933 64.449933
       adbeape.dll   Adobe APE 2011/01/17-12:03:36   64.452786 64.452786
    AdobeLinguistic.dll   Adobe Linguisitc Library   5.0.0  
       AdobeOwl.dll   Adobe Owl 2010/06/03-13:43:23   3.0.93 61.433187
    AdobeOwlCanvas.dll   Adobe Owl Canvas   3.0.68 61.2954
       AdobePDFL.dll   PDFL 2010/12/13-23:37:10   64.341419 64.341419
       AdobePIP.dll   Adobe Product Improvement Program   5.5.0.1265
       AdobeXMP.dll   Adobe XMP Core   5.0 64.140949
    AdobeXMPFiles.dll   Adobe XMP Files   5.0   64.140949
    AdobeXMPScript.dll   Adobe XMP Script   5.0   64.140949
       adobe_caps.dll   Adobe CAPS 4,0,42,0  
    adobe_OOBE_Launcher.dll   Adobe OOBE Launcher   2.0.0.36 (BuildVersion: 2.0; BuildDate: Mon Jan 24 2011 21:49:00) 1.000000
       AFlame.dll   AFlame 2011/01/10-23:33:35   64.444140 64.444140
       AFlamingo.dll   AFlamingo 2011/01/10-23:33:35   64.436825 64.436825
       AGM.dll   AGM 2010/12/13-23:37:10   64.449933 64.449933
       ahclient.dll    AdobeHelp Dynamic Link Library   1,6,0,20
       aif_core.dll   AIF 2.0   53.422628
       aif_ogl.dll   AIF 2.0   53.422628
       amtlib.dll   AMTLib (64 Bit)   4.0.0.21 (BuildVersion: 4.0; BuildDate: Mon Jan 24 2011 21:49:00)   1.000000
    amtservices.dll   AMTServices (64 Bit)   4.0.0.21 (BuildVersion: 4.0; BuildDate: Mon Jan 24 2011 21:49:00) 1.000000
       ARE.dll   ARE 2010/12/13-23:37:10   64.449933 64.449933
       asneu.dll    AsnEndUser Dynamic Link Library   1, 7, 0, 1
       AXE8SharedExpat.dll   AXE8SharedExpat 2011/01/10-23:33:35   64.436825 64.436825
       AXEDOMCore.dll   AXEDOMCore 2011/01/10-23:33:35   64.436825 64.436825
       Bib.dll   BIB 2010/12/13-23:37:10   64.449933 64.449933
       BIBUtils.dll   BIBUtils 2010/12/13-23:37:10   64.449933 64.449933
    boost_threads.dll   DVA Product   5.0.0  
       cg.dll   NVIDIA Cg Runtime   2.0.0015
       cgGL.dll   NVIDIA Cg Runtime   2.0.0015
       CoolType.dll   CoolType 2010/12/13-23:37:10   64.449933 64.449933
       data_flow.dll   AIF   2.0 53.422628
       dvaadameve.dll   DVA Product 5.0.0  
       dvacore.dll   DVA Product 5.0.0  
       dvaui.dll   DVA Product 5.0.0  
    ExtendScript.dll   ExtendScript 2011/01/17-17:14:10   61.452840   61.452840
       FileInfo.dll   Adobe XMP FileInfo   5.0 64.140949
       icucnv36.dll   International Components for Unicode 2009/06/17-13:21:03    Build gtlib_main.9896  
       icudt36.dll   International Components for Unicode 2009/06/17-13:21:03    Build gtlib_main.9896  
       image_flow.dll   AIF 2.0   53.422628
    image_runtime.dll   AIF   2.0 53.422628
       JP2KLib.dll   JP2KLib 2010/12/13-23:37:10   64.181312 64.181312
    libifcoremd.dll   Intel(r) Visual Fortran Compiler   10.0 (Update A)  
       libmmd.dll   Intel(r) C Compiler, Intel(r) C++ Compiler, Intel(r) Fortran Compiler   10.0  
       LogSession.dll   LogSession 2.1.2.1263  
       MPS.dll   MPS 2010/12/13-23:37:10   64.450375 64.450375
       msvcm80.dll   Microsoft® Visual Studio® 2005   8.00.50727.4940  
       msvcm90.dll   Microsoft® Visual Studio® 2008   9.00.30729.6161  
       msvcp80.dll   Microsoft® Visual Studio® 2005   8.00.50727.4940  
       msvcp90.dll   Microsoft® Visual Studio® 2008   9.00.30729.6161  
       msvcr80.dll   Microsoft® Visual Studio® 2005   8.00.50727.4940  
       msvcr90.dll   Microsoft® Visual Studio® 2008   9.00.30729.6161  
    pdfsettings.dll   Adobe PDFSettings   1.04  
       Photoshop.dll   Adobe Photoshop CS5.1   CS5.1
       Plugin.dll   Adobe Photoshop CS5   CS5  
       PlugPlug.dll   Adobe(R) CSXS PlugPlug Standard Dll (64 bit)   2.5.0.232  
       PSArt.dll   Adobe Photoshop CS5.1   CS5.1
       PSViews.dll   Adobe Photoshop CS5.1   CS5.1
       SCCore.dll   ScCore 2011/01/17-17:14:10   61.452840 61.452840
       tbb.dll   Threading Building Blocks   2, 1, 2009, 0201  
       TfFontMgr.dll   FontMgr 9.3.0.113  
       TfKernel.dll   Kernel 9.3.0.113  
       TFKGEOM.dll   Kernel Geom 9.3.0.113  
       TFUGEOM.dll   Adobe, UGeom©   9.3.0.113
    updaternotifications.dll   Adobe Updater Notifications Library   2.0.0.15 (BuildVersion: 1.0; BuildDate: BUILDDATETIME)   2.0.0.15
       WRServices.dll   WRServices Thursday January 21 2010 12:13:3   Build 0.11423   0.11423
       wu3d.dll   U3D Writer 9.3.0.113  
    Installed plug-ins:
       3D Studio 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Accented Edges 12.0
       ADM 3.11x01
       Angled Strokes 12.0
       Average 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Bas Relief 12.0
       BMP 12.0.2
       Camera Raw 6.3
       Chalk & Charcoal 12.0
       Charcoal 12.0
       Chrome 12.0
       Cineon 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Clouds 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Collada 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Color Halftone 12.0.2
       Colored Pencil 12.0
       CompuServe GIF 12.0.2
       Conté Crayon 12.0
       Craquelure 12.0
       Crop and Straighten Photos 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Crop and Straighten Photos Filter 12.0.2
       Crosshatch 12.0
       Crystallize 12.0.2
       Cutout 12.0
       Dark Strokes 12.0
       De-Interlace 12.0.2
       Dicom 12.0
       Difference Clouds 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Diffuse Glow 12.0
       Displace 12.0.2
       Dry Brush 12.0
       Eazel Acquire 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Embed Watermark 4.0
       Entropy 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Extrude 12.0.2
       FastCore Routines 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Fibers 12.0.2
       Film Grain 12.0
       Filter Gallery 12.0
       Fresco 12.0
       Glass 12.0
       Glowing Edges 12.0
       Google Earth 4 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Grain 12.0
       Graphic Pen 12.0
       Halftone Pattern 12.0
       HDRMergeUI 12.0
       IFF Format 12.0.2
       Ink Outlines 12.0
       JPEG 2000 2.0
       Kurtosis 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Lens Blur 12.0
       Lens Correction 12.0.2
       Lens Flare 12.0.2
       Lighting Effects 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Liquify 12.0.1
       Matlab Operation 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Maximum 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Mean 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Measurement Core 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Median 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Mezzotint 12.0.2
       Minimum 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       MMXCore Routines 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Mosaic Tiles 12.0
       Multiprocessor Support 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Neon Glow 12.0
       Note Paper 12.0
       NTSC Colors 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Ocean Ripple 12.0
       OpenEXR 12.0.2
       Paint Daubs 12.0
       Palette Knife 12.0
       Patchwork 12.0
       Paths to Illustrator 12.0.2
       PCX 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Photocopy 12.0
       Photoshop 3D Engine 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Picture Package Filter 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Pinch 12.0.2
       Pixar 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Plaster 12.0
       Plastic Wrap 12.0
       PNG 12.0.2
       Pointillize 12.0.2
       Polar Coordinates 12.0.2
       Portable Bit Map 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Poster Edges 12.0
       Radial Blur 12.0.2
       Radiance 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Range 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Read Watermark 4.0
       Reticulation 12.0
       Ripple 12.0.2
       Rough Pastels 12.0
       Save for Web & Devices 12.0
       ScriptingSupport 12.1
       Shear 12.0.2
       Skewness 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Smart Blur 12.0.2
       Smudge Stick 12.0
       Solarize 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Spatter 12.0
       Spherize 12.0.2
       Sponge 12.0
       Sprayed Strokes 12.0
       Stained Glass 12.0
       Stamp 12.0
       Standard Deviation 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Sumi-e 12.0
       Summation 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Targa 12.0.2
       Texturizer 12.0
       Tiles 12.0.2
       Torn Edges 12.0
       Twirl 12.0.2
       U3D 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Underpainting 12.0
       Vanishing Point 12.0
       Variance 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Variations 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Water Paper 12.0
       Watercolor 12.0
       Wave 12.0.2
       Wavefront|OBJ 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       WIA Support 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       Wind 12.0.2
       Wireless Bitmap 12.1 (12.1x20110328 [20110328.r.145 2011/03/28:10:30:00 cutoff; r branch])
       ZigZag 12.0.2
    Plug-ins that failed to load: NONE
    Flash:
       Mini Bridge
       Access CS Live
       Flash
       Kuler
       CS Review
    Installed TWAIN devices: NONE

    thank you for replying...but it seems an easy answer again  like one given by support....I had photoshop working perfectly before with same video card, I think in one project I clicked something in program (photoshop)that was not ready to correct it by itself... It should be available for the program to give warning several times to the user, I do not know what made Photoshop to disable OpenGL settings, and not be able to reverse action!!!!!  How do I change a GPU sniffer?  I an not a tech, all these things I just learned reading....had spent hundreds of hours....really dissapointed of Adobe and  its support....it is not fair to sell an expensive program without support, it seems to me that  I know now more than a live customer support.

  • Photoshop gives "Program Error" when I try to open files while VPN

    I think this may be a new one. While VPN on my company network, Photoshop CS cannot open any files. Either drag and drop, double click or even file open command. You get the clock and the message "failed to open because of a Program Error.... " or something close to that. I'm sure it says Program Error though. Works fine if I'm not VPN but soon as I'm on it stops opening files or even creating a new blank canvas gives that error. I checked Adobe forum and nothing there to find about this one. Anyone else have this happen?

    Hi, SSI.
    1. What VPN client are you using?
    As a guess, your VPN client may be blocking a port that PS CS may use for license verification over the Internet. The fact that it works AOK when not using the VPN would tend to support this hypothesis. As to what port it may be attempting to use, I can't say, but you may be able to find this out from Adobe and then work with your firm's networking staff to see if this port can be opened for use when the VPN is active.
    2. You noted that you "checked Adobe forum and nothing there to find about this one." Did you post to the Adobe Photoshop forum? If not, I recommend doing so.
    3. You wrote: "You get the clock and the message "failed to open because of a Program Error.... " or something close to that. I'm sure it says Program Error though."As FYI, in cases such as this, copying down the exact text of the message is helpful.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X

  • Can I draw *.bmp, *.png in java.awt.canvas ?

    In paint method of my program, I get image from Toolkit like this:
    public class CanCanvas extends Canvas{
    //In loadImage method
    Toolkit.getDefaultToolkit().getImage(
                        getClass().getClassLoader().getResource(
                                  resource.getString("bg.jpg")));
    //.... In paint method
    if (image != null && image.size() > 0) {
                   for (int j = 0; j < image.size(); j++) {
                        Image image1 = (Image) image.elementAt(j);
                        Rectangle rectangle = (Rectangle) imgLocation.elementAt(j);
                        g.drawImage(image1, rectangle.x, offset + rectangle.y,
                                  rectangle.width, rectangle.height, null);
                        i = i <= rectangle.y + rectangle.height + 7 ? rectangle.y
                                  + rectangle.height + 7 : i;But there is something very strange, if my image is *.jpg or *.gif, it runs ok, otherwise -*.bmp, *.png-, it can't draw the image.
    Would anyone tell me why ? Is the reason java.awt.canvas ?
    Thanks in advance ^ ^

    If you'd bother to read the documentation of the methods you're using, you'd know:
    http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Toolkit.html#getImage(java.lang.String)
    Returns an image which gets pixel data from the specified file, whose format can be either GIF, JPEG or PNG.

  • Programming a Pencil Tool on Paint?

    Here's my code for Scribble(a pencil tool) and its superclass Shape. Basically, my program remembers where the mouse has been and draws a line from the previous point to the current point. However, the scribble doesn't show up (occasionally you will see a small line at the very end) I think the problem is that each Scribble object only has one previous and one current. Therefore, there is only 1 line left at the end. How can I correct this?
    Thanks in advance!
    Note: this doesn't run since there are about 5 other classes needed. I guess can post them if you want? xD
    import java.awt.*;
    public class Scribble extends Shape{
         protected Point startpt, endpt;
         protected Point previous, current;
         int count = 0;
        public Scribble(Point start, DrawingCanvas dcanvas){
         super();
         System.out.println("SCRIBBLE CREATED!!!!!!!\n\n");
         startpt = start;
         current = start;
         endpt = start;
         canvas = dcanvas;
         bounds = new Rectangle(start);
        public void resize(Point anchor, Point end){
         super.resize(anchor, end);
         previous = current;
         startpt = anchor;
         current = end;
         endpt = end;
        public void translate(int dx, int dy){
         super.translate(dx, dy);
         previous.translate(dx, dy);
         current.translate(dx, dy);
         startpt.translate(dx, dy);
         endpt.translate(dx, dy);
        public void draw(Graphics g, Rectangle regionToDraw){
              count++;
              System.out.println(count);
         if (!bounds.intersects(regionToDraw)){
             return;
         g.setColor(super.getColor());
         g.drawLine((int)previous.getX(), (int)previous.getY(), (int)current.getX(), (int)current.getY());
         if (isSelected) { // if selected, draw the resizing knobs
                           // along the 4 corners
             Rectangle[] knobs = getKnobRects();
             for (int i = 0; i < knobs.length; i++)
              g.fillRect(knobs.x, knobs[i].y,
                   knobs[i].width, knobs[i].height);
    protected Rectangle[] getKnobRects(){
         Rectangle[] knobs = new Rectangle[2];
         knobs[0] = new Rectangle((int)startpt.getX() - KNOB_SIZE/2,
                        (int)startpt.getY() - KNOB_SIZE/2, KNOB_SIZE, KNOB_SIZE);
         knobs[1] = new Rectangle((int)endpt.getX() - KNOB_SIZE/2,
                        (int)endpt.getY()- KNOB_SIZE/2, KNOB_SIZE, KNOB_SIZE);
         return knobs;
    protected int getKnobContainingPoint(Point pt){
         if (!isSelected) return NONE;
         Rectangle[] knobs = getKnobRects();
         for (int i = 0; i < knobs.length; i++)
         if (knobs[i].contains(pt))
              return i;
         return NONE;
    }import java.awt.*;
    import java.util.*;
    import java.io.*;
    public abstract class Shape implements Serializable, Cloneable{
         private Color color;
    protected Rectangle bounds;
    protected boolean isSelected;
    public DrawingCanvas canvas;
    protected static final int KNOB_SIZE = 6;
    protected static final int NONE = -1;
    protected static final int NW = 0;
    protected static final int SW = 1;
    protected static final int SE = 2;
    protected static final int NE = 3;
         Shape(){
              color = Color.darkGray;
         public Color getColor(){
         return color;
         public Object clone(){
              try{
              Shape copy = (Shape)super.clone();
              copy.setBounds(bounds);
              return copy;
              catch(CloneNotSupportedException c){
                   return null;
         public void setColor(Color newColor){
         color = newColor;
         canvas.repaint();
         /** The "primitive" for all resizing/moving/creating operations that
         * affect the rect bounding box. The current implementation just resets
         * the bounds variable and triggers a re-draw of the union of the old &
         * new rectangles. This will redraw the shape in new size and place and
         * also "erase" if bounds are now smaller than before.
         protected void setBounds(Rectangle newBounds){
              Rectangle oldBounds = bounds;
              bounds = newBounds;
              updateCanvas(oldBounds.union(bounds));
         /** The resize operation is called when first creating a rect, as well as
         * when later resizing by dragging one of its knobs. The two parameters
         * are the points that define the new bounding box. The anchor point
         * is the location of the mouse-down event during a creation operation
         * or the opposite corner of the knob being dragged during a resize
         * operation. The end is the current location of the mouse.
         public void resize(Point anchor, Point end){
              Rectangle newRect = new Rectangle(anchor);
              // creates smallest rectange which
              // includes both anchor & end
              newRect.add(end);
              // reset bounds & redraw affected areas
              setBounds(newRect);
              canvas.repaint();
         /** The translate operation is called when moving a shape by dragging in
         * the canvas. The two parameters are the delta-x and delta-y to move
         * by. Note that either or both can be negative. Create a new rectangle
         * from our bounds and translate and then go through the setBounds()
         * primitive to change it.
         public void translate(int dx, int dy){
              Rectangle newRect = new Rectangle(bounds);
              newRect.translate(dx, dy);
              setBounds(newRect);
              canvas.repaint();
         /** Used to change the selected state of the shape which will require
         * updating the affected area of the canvas to add/remove knobs.
         public void setSelected(boolean newState){
              isSelected = newState;
              // need to erase/add knobs
              // including extent of extended bounds
              updateCanvas(bounds, true);
              canvas.repaint();
         /** The updateCanvas() methods are used when the state has changed
         * in such a way that it needs to be refreshed in the canvas to properly
         * reflect the new settings. The shape should take responsibility for
         * messaging the canvas to properly update itself. The appropriate AWT/JFC
         * way to re-draw a component is to send it the repaint() method with the
         * rectangle that needs refreshing. This will cause an update() event to
         * be sent to the component which in turn will call paint(), where the
         * real drawing implementation goes. See the paint() method in
         * DrawingCanvas to see how it is implemented.
         protected void updateCanvas(Rectangle areaOfChange, boolean enlargeForKnobs){
                   System.out.println("canvas2 updated");
              Rectangle toRedraw = new Rectangle(areaOfChange);
              if (enlargeForKnobs)
              toRedraw.grow(KNOB_SIZE/2, KNOB_SIZE/2);
              canvas.repaint(toRedraw);
         protected void updateCanvas(Rectangle areaOfChange){
                   System.out.println("canvas updated");
              updateCanvas(areaOfChange, isSelected);
              public Rectangle getBounds(){
                   return bounds;
         /** When the DrawingCanvas needs to determine which shape is under
         * the mouse, it asks the shape to determine if a point is "inside".
         * This method should returns true if the given point is inside the
         * region for this shape. For a rectangle, any point within the
         * bounding box is inside the shape.
         public boolean inside(Point pt){
              return bounds.contains(pt);
         /** When needed, we create the array of knob rectangles on demand. This
         * does mean we create and discard the array and rectangles repeatedly.
         * These are small objects, so perhaps it is not a big deal, but
         * a valid alternative would be to store the array of knobs as an
         * instance variable of the Shape and and update the knobs as the bounds
         * change. This means a little more memory overhead for each Shape
         * (since it is always storing the knobs, even when not being used) and
         * having that redundant data opens up the possibility of bugs from
         * getting out of synch (bounds move but knobs didn't, etc.) but you may
         * find that a more appealing way to go. Either way is fine with us.
         * Note this method provides a nice unified place for one override from
         * a shape subclass to substitute fewer or different knobs.
         protected Rectangle[] getKnobRects(){
                   System.out.println("knobs gotten");
              Rectangle[] knobs = new Rectangle[4];
              knobs[NW] = new Rectangle(bounds.x - KNOB_SIZE/2,
                             bounds.y - KNOB_SIZE/2, KNOB_SIZE, KNOB_SIZE);
              knobs[SW] = new Rectangle(bounds.x - KNOB_SIZE/2,
                             bounds.y + bounds.height - KNOB_SIZE/2,
                             KNOB_SIZE, KNOB_SIZE);
              knobs[SE] = new Rectangle(bounds.x + bounds.width - KNOB_SIZE/2,
                             bounds.y + bounds.height - KNOB_SIZE/2,
                             KNOB_SIZE, KNOB_SIZE);
              knobs[NE] = new Rectangle(bounds.x + bounds.width - KNOB_SIZE/2,
                             bounds.y - KNOB_SIZE/2,
                             KNOB_SIZE, KNOB_SIZE);
              return knobs;
         /** Helper method to determine if a point is within one of the resize
         * corner knobs. If not selected, we have no resize knobs, so it can't
         * have been a click on one. Otherwise, we calculate the knob rects and
         * then check whether the point falls in one of them. The return value
         * is one of NW, NE, SW, SE constants depending on which knob is found,
         * or NONE if the click doesn't fall within any knob.
         protected int getKnobContainingPoint(Point pt){
                   System.out.println("resize knobs");
              // if we aren't selected, the knobs
              // aren't showing and thus there are no knobs to check
              if (!isSelected) return NONE;
              Rectangle[] knobs = getKnobRects();
              for (int i = 0; i < knobs.length; i++)
              if (knobs[i].contains(pt))
                   return i;
              return NONE;
         /** Method used by DrawingCanvas to determine if a mouse click is starting
         * a resize event. In order for it to be a resize, the click must have
         * been within one of the knob rects (checked by the helper method
         * getKnobContainingPoint) and if so, we return the "anchor" ie the knob
         * opposite this corner that will remain fixed as the user drags the
         * resizing knob of the other corner around. During the drag actions of a
         * resize, that fixed anchor point and the current mouse point will be
         * passed to the resize method, which will reset the bounds in response
         * to the movement. If the mouseLocation wasn't a click in a knob and
         * thus not the beginning of a resize event, null is returned.
    public Point getAnchorForResize(Point mouseLocation){
              System.out.println("is it a resize?");
    int whichKnob = getKnobContainingPoint(mouseLocation);
    if (whichKnob == NONE) // no resize knob is at this location
    return null;
    Rectangle[] knobs = getKnobRects();
    whichKnob = Math.abs(whichKnob - (int)(knobs.length / 2));
    return (new Point(knobs[whichKnob].x + knobs[whichKnob].width /2,
    knobs[whichKnob].y + knobs[whichKnob].height/2));
    public abstract void draw(Graphics g, Rectangle regionToDraw);

    line left at the end. How can I correct this?java.awt.Polygon (or Polygon2D)
    Here are a few of my thoughts
    #1 There is a Shape interface in core java already, as well as plenty of very useful shapes (Rectangle, Ellipse2D, Area). Shape has some really nice features like contains(...) and intersects(...). By creating a separate class for your Shape objects, you ensure that the two will be incompatible.
    #2 As tempting as it is, it is a bad idea to include a Color with a shape. What if you want it to have more than one Color? What if you want the insides of the shape to be filled by an Image? I just created and posted a class on the java forums called Renderable, which combines a java.awt.Shape with a java.awt.Paint.
    #3 Below is my PaintArea class. It "scribbles" on an Image. Maybe this will give you some ideas. To compile it, you will either have to find my MathUtils class (which I've posted here before) or reimplement the distance and angle methods. There is also a reference to WIndowUtilities... find that or remove it and put the PaintArea in a Frame and do setVisible(true)
    You are welcome to use and modify this code, but please don't change the package and please make sure that you add attribution if you submit this in an academic setting.
    * Created on Jun 15, 2005 by @author Tom Jacobs
    package tjacobs.ui.ex;
    import java.awt.image.BufferedImage;
    import java.awt.*;
    import java.awt.event.*;
    import java.beans.PropertyChangeEvent;
    import java.beans.PropertyChangeListener;
    import javax.swing.ImageIcon;
    import javax.swing.JComboBox;
    import javax.swing.JComponent;
    import javax.swing.JPanel;
    import javax.swing.JToolBar;
    import tjacobs.MathUtils;
    import tjacobs.ui.util.WindowUtilities;
    * PaintArea is a component that you can draw in similar to but
    * much simpler than the windows paint program.
    public class PaintArea extends JComponent {
         private static final long serialVersionUID = 0;
         BufferedImage mImg; //= new BufferedImage();
         int mBrushSize = 1;
         private boolean mSizeChanged = false;
         private Color mColor1, mColor2;
         static class PaintIcon extends ImageIcon {
              public static final long serialVersionUID = 0;
              int mSize;
              public PaintIcon(Image im, int size) {
                   super(im);
                   mSize = size;
         public PaintArea() {
              super();
              setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
              addComponentListener(new CListener());
              MListener ml = new MListener();
              addMouseListener(ml);
              addMouseMotionListener(ml);
              setBackground(Color.WHITE);
              setForeground(Color.BLACK);
         public void paintComponent(Graphics g) {
              if (mSizeChanged) {
                   handleResize();
              //g.drawImage(mImg, mImg.getWidth(), mImg.getHeight(), null);
              g.drawImage(mImg, 0, 0, null);
              //super.paintComponent(g);
              //System.out.println("Image = " + mImg);
              //System.out.println("Size: " + mImg.getWidth() + "," + mImg.getHeight());
         public void setBackground(Color c) {
              super.setBackground(c);
              if (mImg != null) {
                   Graphics g = mImg.getGraphics();
                   g.setColor(c);
                   g.fillRect(0, 0, mImg.getWidth(), mImg.getHeight());
                   g.dispose();
         public void setColor1(Color c) {
              mColor1 = c;
         public void setColor2(Color c) {
              mColor2 = c;
         public Color getColor1() {
              return mColor1;
         public Color getColor2() {
              return mColor2;
         class ToolBar extends JToolBar {
              private static final long serialVersionUID = 1L;
              ToolBar() {
                   final ColorButton fore = new ColorButton();
                   fore.setToolTipText("Foreground Color");
                   final ColorButton back = new ColorButton();
                   back.setToolTipText("Background Color");
                   JComboBox brushSize = new JComboBox();
                   //super.createImage(1, 1).;
                   FontMetrics fm = new FontMetrics(getFont()) {
                        private static final long serialVersionUID = 1L;};
                   //int ht = fm.getHeight();
                   int useheight = fm.getHeight() % 2 == 0 ? fm.getHeight() + 1 : fm.getHeight();
                   final BufferedImage im1 = new BufferedImage(useheight, useheight, BufferedImage.TYPE_INT_RGB);
                   Graphics g = im1.getGraphics();
                   g.setColor(Color.WHITE);
                   g.fillRect(0, 0, useheight, useheight);
                   g.setColor(Color.BLACK);
                   g.fillOval(useheight / 2, useheight / 2, 1, 1);
                   g.dispose();
                   //im1.setRGB(useheight / 2 + 1, useheight / 2 + 1, 0xFFFFFF);
                   final BufferedImage im2 = new BufferedImage(useheight, useheight, BufferedImage.TYPE_INT_RGB);
                   g = im2.getGraphics();
                   g.setColor(Color.WHITE);
                   g.fillRect(0, 0, useheight, useheight);
                   g.setColor(Color.BLACK);
                   g.fillOval(useheight / 2 - 1, useheight / 2 - 1, 3, 3);
                   g.dispose();
    //               im2.setRGB(useheight / 2 - 1, useheight / 2 - 1, 3, 3, new int[] {     0, 0xFFFFFF, 0,
    //                                                            0xFFFFFF, 0xFFFFFFF, 0xFFFFFF,
    //                                                            0, 0xFFFFFF, 0}, 0, 1);
                   final BufferedImage im3 = new BufferedImage(useheight, useheight, BufferedImage.TYPE_INT_RGB);
                   g = im3.getGraphics();
                   g.setColor(Color.WHITE);
                   g.fillRect(0, 0, useheight, useheight);
                   g.setColor(Color.BLACK);
                   g.fillOval(useheight / 2 - 2, useheight / 2 - 2, 5, 5);
                   g.dispose();
    //               im3.setRGB(useheight / 2 - 2, useheight / 2 - 2, 5, 5, new int[] {     0, 0, 0xFFFFFF, 0, 0, 
    //                                                            0, 0xFFFFFF, 0xFFFFFFF, 0xFFFFFF, 0,
    //                                                            0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF,
    //                                                            0, 0xFFFFFF, 0xFFFFFFF, 0xFFFFFF, 0,
    //                                                            0, 0, 0xFFFFFF, 0, 0}, 0, 1);
                   //JLabel l1 = new JLabel("1 pt", new ImageIcon(im1), JLabel.LEFT);
                   //JLabel l2 = new JLabel("3 pt", new ImageIcon(im2), JLabel.LEFT);
                   //JLabel l3 = new JLabel("5 pt", new ImageIcon(im3), JLabel.LEFT);
                   brushSize.addItem(new PaintIcon(im1, 1));
                   brushSize.addItem(new PaintIcon(im2, 3));
                   brushSize.addItem(new PaintIcon(im3, 5));
                   //brushSize.addItem("Other");
                   add(fore);
                   add(back);
                   add(brushSize);
                   PropertyChangeListener pl = new PropertyChangeListener() {
                        public void propertyChange(PropertyChangeEvent ev) {
                             Object src = ev.getSource();
                             if (src != fore && src != back) {
                                  return;
                             Color c = (Color) ev.getNewValue();
                             if (ev.getSource() == fore) {
                                  mColor1 = c;
                             else {
                                  mColor2 = c;
                   fore.addPropertyChangeListener("Color", pl);
                   back.addPropertyChangeListener("Color", pl);
                   fore.changeColor(Color.BLACK);
                   back.changeColor(Color.WHITE);
                   brushSize.addItemListener(new ItemListener() {
                        public void itemStateChanged(ItemEvent ev) {
                             System.out.println("ItemEvent");
                             if (ev.getID() == ItemEvent.DESELECTED) {
                                  return;
                             System.out.println("Selected");
                             Object o = ev.getItem();
                             mBrushSize = ((PaintIcon) o).mSize;
                   //Graphics g = im1.getGraphics();
                   //g.fillOval(0, 0, 1, 1);
                   //BufferedImage im1 = new BufferedImage();
                   //BufferedImage im1 = new BufferedImage();
         protected class MListener extends MouseAdapter implements MouseMotionListener {
              Point mLastPoint;
              public void mouseDragged(MouseEvent me) {
                   Graphics g = mImg.getGraphics();
                   if ((me.getModifiers() & InputEvent.BUTTON1_MASK) != 0) {
                        g.setColor(mColor1);
                   } else {
                        g.setColor(mColor2);
                   Point p = me.getPoint();
                   if (mLastPoint == null) {
                        g.fillOval(p.x - mBrushSize / 2, p.y - mBrushSize / 2, mBrushSize, mBrushSize);
                        //g.drawLine(p.x, p.y, p.x, p.y);
                   else {
                        g.drawLine(mLastPoint.x, mLastPoint.y, p.x, p.y);
                        //g.fillOval(p.x - mBrushSize / 2, p.y - mBrushSize / 2, mBrushSize, mBrushSize);
                        double angle = MathUtils.angle(mLastPoint, p);
                        if (angle < 0) {
                             angle += 2 * Math.PI;
                        @SuppressWarnings("unused")
                        double distance = MathUtils.distance(mLastPoint, p) * 1.5;
                        if (angle < Math.PI / 4 || angle > 7 * Math.PI / 4 || Math.abs(Math.PI - angle) < Math.PI / 4) {
                             for (int i = 0; i < mBrushSize / 2; i ++) {
                                  g.drawLine(mLastPoint.x, mLastPoint.y + i, p.x, p.y + i);
                                  g.drawLine(mLastPoint.x, mLastPoint.y - i, p.x, p.y - i);
    //                              System.out.println("y");
    //                              System.out.println("angle = " + angle / Math.PI * 180);
                        else {
                             for (int i = 0; i < mBrushSize / 2; i ++) {
                                  g.drawLine(mLastPoint.x + i, mLastPoint.y, p.x + i, p.y);
                                  g.drawLine(mLastPoint.x  - i, mLastPoint.y, p.x - i, p.y);
    //                              System.out.println("x");
    //                    System.out.println("new = " + PaintUtils.printPoint(p));
    //                    System.out.println("last = " + PaintUtils.printPoint(mLastPoint));
                        //System.out.println("distance = " + distance);
                        //Graphics2D g2 = (Graphics2D) g;
                        //g2.translate(mLastPoint.x + mBrushSize / 2, mLastPoint.y);
                        //g2.rotate(angle);
                        //g2.fillRect(0, 0, (int) Math.ceil(distance), mBrushSize);
                        //g2.rotate(-angle);
                        //g2.translate(-mLastPoint.x + mBrushSize / 2, -mLastPoint.y);
    //                    g.setColor(Color.RED);
    //                    g.drawRect(p.x, p.y, 1, 1);
                   mLastPoint = p;
                   g.dispose();
                   repaint();
              public void mouseMoved(MouseEvent me) {}
              public void mouseReleased(MouseEvent me) {
                   mLastPoint = null;
         private void handleResize() {
              Dimension size = getSize();
              mSizeChanged = false;
              if (mImg == null) {
                   mImg = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB);
                   Graphics g = mImg.getGraphics();
                   g.setColor(getBackground());
                   g.fillRect(0, 0, mImg.getWidth(), mImg.getHeight());
                   g.dispose();
              else {
                   int newWidth = Math.max(mImg.getWidth(),getWidth());
                   int newHeight = Math.max(mImg.getHeight(),getHeight());
                   if (newHeight == mImg.getHeight() && newWidth == mImg.getWidth()) {
                        return;
                   BufferedImage bi2 = new BufferedImage(newWidth, newHeight, BufferedImage.TYPE_INT_RGB);
                   Graphics g = bi2.getGraphics();
                   g.setColor(getBackground());
                   g.fillRect(0, 0, bi2.getWidth(), bi2.getHeight());
                   g.drawImage(mImg, mImg.getWidth(), mImg.getHeight(), null);
                   g.dispose();
                   mImg = bi2;
         public JToolBar getToolBar() {
              if (mToolBar == null) {
                   mToolBar = new ToolBar();
              return mToolBar;
         private ToolBar mToolBar;
         public static void main (String args[]) {
              PaintArea pa = new PaintArea();
              JPanel parent = new JPanel();
              parent.setLayout(new BorderLayout());
              parent.add(pa, BorderLayout.CENTER);
              pa.setPreferredSize(new Dimension(150, 150));
              parent.add(pa.getToolBar(), BorderLayout.NORTH);
              WindowUtilities.visualize(parent);
         protected class CListener extends ComponentAdapter {
              public void componentResized(ComponentEvent ce) {
                   mSizeChanged = true;
    }

Maybe you are looking for

  • Generic Datasource on table IMRG in R/3- delta on timestamp is it ok ?

    Hi I am creating Generic datasource based on table IMRG in R/3, This has stoppages related data. which we need in BI report. There is a field for Time-stamp in the table, i have checked values in table IMRG, but in R/3 it shows no data for the time-s

  • HP Photosmart 6510 e-All-in-O​ne

    Paper jam!

  • LocalConnection domain null problem

    Hi all, I started to migrate flex app to air mobile project and i can't get over one problem with LocalConnection, which does not dispatch any StatusEvent when I call send method on it. No Security or Async error events are dispatched. Could it be, b

  • Design Help for ISG & SCE

    Hi, Kindly find attached the diagram for one of the small ISP. Wireless users will be terminated on 2 WAN/POP Router 7609-S. One 7609-S has 2 WiSM & the other 7609-S has 1 WiSM. My query is: how best i can design my ISG & SCE so that i achieve full r

  • Creating shared variables bound to I/O Aliases

    Hello, I'm running LabVIEW 2012. When I right-click on an .lvlib in the project explorer, there's a "Create Bound Variables" option. It's really convenient, as it automatically binds many variables to generic network-published shared variables simult