Help load photolibrary image in to iphone UIWebView?

Is it possible to load an image from iphone photolibrary to a UIWebView window? Something is wrong here:
- (void)useImage:(UIImage *)theImage {
imageView.image = theImage;
I think it doesn't understand ".image". Which is what I use in UIImageView. What did I miss?
Any idea?

BTW
The Error below the above code is:
"error: request for member 'image' in something not a structure or union"

Similar Messages

  • Help loading an image file

    Hi, I have an image on my movie that I am now able to move around and resize. What I want now is to replae this image with a different one (ie. user's own logo) by displaying a file browser window when user clicks on the current image.
    My actual image is "your_logo.png". Please bear in mind I am VERY new to Flash Builder. Here´s my code:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application 
    xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="
    library://ns.adobe.com/flex/spark" xmlns:mx="
    library://ns.adobe.com/flex/mx" width="
    874" height="700">
    <fx:Script>
    <![CDATA[
     import mx.controls.Alert; 
    import mx.events.FlexEvent; 
    import mx.managers.CursorManager; 
    Bindable][
    Embed(source="images/moveCursor.png")] 
    private var myCursorIcon:Class; 
    protected function clickHandler(event:MouseEvent):void{
    CursorManager.setCursor(myCursorIcon);
    protected function resetHandler(event:MouseEvent):void{
    CursorManager.removeAllCursors();
    // esta función hace que al reducir y ampliar imágenes, estas no se distorsionen 
    private function smoothImage(evt:Event):void{ 
    var myBitmap:Bitmap = ((evt.target as Image).content as Bitmap); 
    if (myBitmap != null) {myBitmap.smoothing =
    true;}
    // esta función hace que podamos manipular el tamaño del texto con un slider. Una para cada texto. 
    protected function resizeMyName_changeHandler(event:Event):void{
    // TODO Auto-generated method stubMyName.textFlow.fontSize = resizeMyName.value;
    protected function resizeMyAddress_changeHandler(event:Event):void{
    // TODO Auto-generated method stubMyAddress.textFlow.fontSize = resizeMyAddress.value;
    protected function resizeMyPhone_changeHandler(event:Event):void{
    // TODO Auto-generated method stubMyPhone.textFlow.fontSize = resizeMyPhone.value;
    protected function resizeMyFax_changeHandler(event:Event):void{
    // TODO Auto-generated method stubMyFax.textFlow.fontSize = resizeMyFax.value;
    protected function resizeMyMobile_changeHandler(event:Event):void{
    // TODO Auto-generated method stubMyMobile.textFlow.fontSize = resizeMyMobile.value;
    protected function resizeMyEmail_changeHandler(event:Event):void{
    // TODO Auto-generated method stubMyEmail.textFlow.fontSize = resizeMyEmail.value;
    protected function resizeMyWebsite_changeHandler(event:Event):void{
    // TODO Auto-generated method stubMyWebsite.textFlow.fontSize = resizeMyWebsite.value;
    ]]>
    </fx:Script>
     <s:BorderContainer x="10" y="10" width="853" height="680" backgroundColor="#F0EEEE">
     <s:BorderContainer 
    width="
    630" height="
    394" x="
    33" y="170" borderVisible="
    true" dropShadowVisible="
    true" borderColor="#E1E1E1">
     <s:layout>
     <s:BasicLayout/>
     </s:layout>
     <s:RichEditableText id="
    MyAddress"text="
    my address here" fontSize="
    12"mouseDown="MyAddress.startDrag();"
    mouseUp="MyAddress.stopDrag();"
    mouseOut="resetHandler(event)"
    mouseOver="clickHandler(event)"
    x="
    114" y="64" fontFamily="Verdana" textAlign="right" 
    />
     <s:RichEditableText id="
    MyWebsite"text="
    my website here" fontSize="
    12"mouseDown="MyWebsite.startDrag();"
    mouseUp="MyWebsite.stopDrag();"
    mouseOut="resetHandler(event)"
    mouseOver="clickHandler(event)"
    x="
    115" y="158" fontFamily="Verdana" textAlign="right"/>
     <s:RichEditableText id="
    MyPhone"text="
    my phone here" fontSize="
    12"mouseDown="MyPhone.startDrag();"
    mouseUp="MyPhone.stopDrag();"
    mouseOut="resetHandler(event)"
    mouseOver="clickHandler(event)"
    x="
    125" y="82" fontFamily="Verdana" textAlign="right"/>
     <s:RichEditableText id="
    MyFax"text="
    my fax here" fontSize="
    12"mouseDown="MyFax.startDrag();"
    mouseUp="MyFax.stopDrag();"
    mouseOut="resetHandler(event)"
    mouseOver="clickHandler(event)"
    x="
    146" y="99" fontFamily="Verdana" textAlign="right"/>
     <s:RichEditableText id="
    MyMobile"text="
    my mobile here" fontSize="
    12"mouseDown="MyMobile.startDrag();"
    mouseUp="MyMobile.stopDrag();"
    mouseOut="resetHandler(event)"
    mouseOver="clickHandler(event)"
    x="
    124" y="116" fontFamily="Verdana" textAlign="right"/>
     <s:RichEditableText id="
    MyEmail"text="
    my email here" fontSize="
    12"mouseDown="MyEmail.startDrag();"
    mouseUp="MyEmail.stopDrag();"
    mouseOut="resetHandler(event)"
    mouseOver="clickHandler(event)"
    x="
    132" y="133" fontFamily="Verdana" textAlign="right"/>
     <s:RichEditableText id="
    MyName"text="
    my name here" fontSize="
    24"mouseDown="MyName.startDrag();"
    mouseUp="MyName.stopDrag();"
    mouseOut="resetHandler(event)"
    mouseOver="clickHandler(event)"
    x="
    50" y="23" fontFamily="Verdana" textAlign="right" 
    />
     <mx:Image x="289" y="
    289" source="
    images/your_logo.png"mouseDown="img1.startDrag();"
    mouseUp="img1.stopDrag();"
    mouseOut="resetHandler(event)"
    mouseOver="clickHandler(event)"
    id="
    img1"complete="smoothImage(event)"
    />
     </s:BorderContainer>
     <s:BorderContainer x="11" y="10" width="830" height="114" borderVisible="true" cornerRadius="20" borderColor="#D4D4D4">
     <mx:Image x="20" y="
    7" source="
    images/logo_construction.png" 
    />
     </s:BorderContainer>
     <s:HSlider x="
    711" y="
    235" minimum="
    100" maximum="
    350"change="img1.width=event.currentTarget.value"
    liveDragging="
    true" value="
    350" stepSize="10" id="resizeLogo"/>
     <s:Label x="711" y="
    190" text="
    RESIZE" fontWeight="
    bold" fontFamily="
    Verdana" fontSize="
    10"/>
     <s:Label x="712" y="
    252" text="
    my name" fontWeight="
    normal" fontFamily="
    Verdana" fontSize="
    10"/>
     <s:Label x="712" y="
    222" text="
    logo" fontWeight="
    normal" fontFamily="
    Verdana" fontSize="
    10"/>
     <s:HSlider x="
    711" y="
    264" value="
    24" stepSize="
    2" maximum="
    24" minimum="
    14" id="
    resizeMyName"liveDragging="
    true"change="resizeMyName_changeHandler(event)"
    />
     <s:HSlider x="
    712" y="
    296.15" value="
    12" stepSize="
    1" maximum="
    18" minimum="
    12" id="
    resizeMyAddress"change="resizeMyAddress_changeHandler(event)"
    />
     <s:HSlider x="
    712" y="
    324" value="
    12" stepSize="
    1" maximum="
    18" minimum="
    12" id="
    resizeMyPhone"change="resizeMyPhone_changeHandler(event)"
    />
     <s:HSlider x="
    712" y="
    353" value="
    12" stepSize="
    1" maximum="
    18" minimum="
    12" id="
    resizeMyFax"change="resizeMyFax_changeHandler(event)"
    />
     <s:HSlider x="
    712" y="
    380" value="
    12" stepSize="
    1" maximum="
    18" minimum="
    12" id="
    resizeMyMobile"change="resizeMyMobile_changeHandler(event)"
    />
     <s:HSlider x="
    712" y="
    406" value="
    12" stepSize="
    1" maximum="
    18" minimum="
    12" id="
    resizeMyEmail"change="resizeMyEmail_changeHandler(event)"
    />
     <s:HSlider x="
    712" y="
    432" value="
    12" stepSize="
    1" maximum="
    18" minimum="
    12" id="
    resizeMyWebsite"change="resizeMyWebsite_changeHandler(event)"
    />
     <s:Label x="712.5" y="
    284.15" text="
    my address" fontWeight="
    normal" fontFamily="
    Verdana" fontSize="
    10"/>
     </s:BorderContainer></s:Application>

    Kokorito I have added this to my code:
    proteced var fileRef:FileReference;fileRef =
    new FileReference();fileRef.addEventListener(Event.COMPLETE,loadComplete);
    fileRef.load();
    img1.source = fileRef.data;
    but I get  the following message:
    1004: Namespace was not found or is not a compile-time constant.
    Am I missing something?

  • Help loading an image from photoshop into flash..

    I have a script written that will take an image open in photoshop, save a copy of it (as a jpeg), and I want to
    open that file in a new flash window that I open. The property app.activeDocument.full name does not actually return
    the full name, it returns "~/Desktop/Pictures/fileName.jpg", instead of "C:/Users/me/Desktop/Pictures/fileName.jpg".
    I know I can do an image import from flash, but I would rather pass the information directly to the flash.
    How can I pass the absolute file path to the flash from photoshop?

    app.activeDocument.fullName.fsName will get you the full path to the file but if the document has not been saved it will throw an error.

  • Need help loading songs from computer to iPhone

    Problem moving songs from computer to iPone in same order

    How are you trying to get music on the phone, either via sync or manually manage music? And, what are you referring to when you say "in same order"?

  • HELP: How do I use iPhoto 08 to import images onto my iPhone 3G?

    Hi,
    I was wondering how best to import images into my iPhone 3G for viewing.
    Most of my image files are large high quality 2 -4 MB files.
    Is there an easy way to downsize the files for viewing on the iPhone 3G? Does iPhoto have a setting specific for import/export use with the iPhone?
    How do I set a specific photo as the phone's wallpaper and does it have to be specifically sized to use as wallpaper?
    I have read the iPhone 3G manual but it was less than helpful just saying "Use iPhoto to import photos onto your iPhone"...

    here is a thread with lots of discussion of this topic - http://discussions.apple.com/thread.jspa?threadID=1618079&tstart=105
    In general you make album(s) of the photos you want on the iPhone and sync the album(s)
    LN

  • [noob needs help] Loading image from a URL

    Hey everyone. I'm new here. And I'm new at J2ME as well.
    I have a simple school project and I have doubts about it. I've searched everywhere on the net yet I could not find the solution. Anyways, I do understand the concept of loading images by putting the files in the "res" folder and use:
    try
    img = Image.createImage("/burgerimgsmall.jpg");
    catch (Exception e)
    e.printStackTrace();
    But my project requires me to load an image from a URL. How do I go about doing that? If it helps, here's the URL:
    http://img.photobucket.com/albums/v703/punkgila/burgerimgsmall.jpg
    Thanks guys!

    Don't worry, downloading image from http is also simple. Look into Photoalbum demo in wtk2.5

  • ITunes tells me, that I need to load version 11.1 in order to load a backup into my iPhone 5. I'm working with a windows PC and want to update my phone to iOS 7GM. version 11.0.5 is the highest I can get for windows. Can somebody help me?

    iTunes tells me, that I need to load version 11.1 in order to load a backup into my iPhone 5. I'm working with a windows PC and want to update my phone to iOS 7GM. version 11.0.5 is the highest I can get for windows. Can somebody help me?

    I'm assuming you followed a forum like Gizmodo to load the latest version of iOS 7 Beta on your device
    Alot of those forums forget to mention, iTunes 11.0.5 will allow you to update to the iOS 7 Beta but your device will no longer work unless you have the developer version of iTunes as well....
    I'd suggest you to research how to downgrade back to 6.1.3/4 and wait a few days for the iOS to be released,

  • URGENT : Please HELP : Loading a first image too slow

    Hello,
    I want to load an image to save it just before in a JPG format so as to obtain finally a byte[] array of this JPG image result.
    So, to do it, I tried to load my Image from different ways but I have always a strange comportement... My problem come from the reading :
    First, I use the imageio classes...
    FileImageInputStream fiis = new FileImageInputStream(file);
    BufferedImage input = ImageIO.read(fiis);
    And then, I use the oldest method :
    Image image = new ImageIcon(file.getAbsolutePath()).getImage();
    BufferedImage input = new BufferedImage(image.getWidth(panel), image.getHeight(panel),BufferedImage.TYPE_INT_RGB);
    and also :
    Image image = new ImageIcon(file.getAbsolutePath()).getImage();
    BufferedImage input = toBufferedImage(picture);
    But finally, I understood my problem is that the first time I load an image (no matter the format, JPG, BMP, TIFF... or other) the loading phase is very slow and lasts at least 30 sec. But then, every loading that I do will gonna be really fast. (No more than 1 sec.) It's look like if the first time there was a kind of dinamical alocation or something like that.... but I tried to find some configuration parameters to set it... But without success. :-(
    If someone could have an idea to suggest me... it would help me very much.
    Thanks in advance for your help,
    Anthony

    Please someone can help me ?!? A suggestion ?
    I have tried today one more time to resolve this issue... but without success... Anything I do with the loading of an image... by imageio or other ways... it's still the same problem... the first time I load an image, it takes me 40 - 50 sec to load it and after this first load, it is very fast with others... and with every formats. It's not a question of format but of memory allocation, I think... but I'm not sure...
    PRECISION : I work with an applet, is there something to configurate to allocate some memories or another thing ?!?
    Thanks in advance for your help, I really need it just right now... I have to finish this job extremly fast !!!
    Regards,
    Anthony

  • Help With Loading an Image In AIR

    I need to load an image (GIF) with AIR using File and FileStream, but can't figure out how to do it. I need to load the image into a Bitmap or BitmapData object, so I can't use the loader class. Here's what I have so far:
    import flash.display.*;
    import flash.events.*;
    import flash.filesytem.*;
    import flash.net.FileFilter;
    import flash.utils.ByteArray;
    import flash.geom.Rectangle;
    var file:File = File.documentsDirectory;
    var myImage:BitmapData;
    var myFilter:FileFilter = new FileFilter("GIF Image","*.gif");
    file.addEventListener(Event.SELECT,loadImage);
    file.browseForOpen("Open",[myFilter]);
    function loadImage(e:Event):void{
    var stream:FileStream = new FileStream();
    stream.open(file,FileMode.READ);
    var bytes:ByteArray = new ByteArray();
    stream.readBytes(bytes);
    stream.close();
    //By the way, this image is a special format and will always be 160 by 160 pixels.
    myImage = new BitmapData(160,160);
    bytes.position = 0;
    myImage.setPixels(new Rectangle(0,0,160,160),bytes);
    addChild(new Bitmap(myImage));
    However, this never works. I always get this error:
    Error #2030: End of file was encountered.
    I don't quite understand why. Help would be much appreciated.

    I already know how to do that, but I specifically stated in my post that I can't use the Loader class. The reason for that is that my program is an image manipulation program, and I need to load the data into a BitmapData object. However, since I originally made my post, I have found some more information. I used trace() to find out the length of the ByteArray I was loading the data into, and then the position after trying to create the BitmapData object, like so:
    import flash.display.*;
    import flash.events.*;
    import flash.filesytem.*;
    import flash.net.FileFilter;
    import flash.utils.ByteArray;
    import flash.geom.Rectangle;
    import flash.errors.EOFError;
    var file:File = File.documentsDirectory;
    var myImage:BitmapData;
    var myFilter:FileFilter = new FileFilter("GIF Image","*.gif");
    file.addEventListener(Event.SELECT,loadImage);
    file.browseForOpen("Open",[myFilter]);
    function loadImage(e:Event):void{
         var stream:FileStream = new FileStream();
         stream.open(file,FileMode.READ);
         var bytes:ByteArray = new ByteArray();
         stream.readBytes(bytes);
         stream.close();
         trace(bytes.length); //Outputs: 4631
         //By the way, this image is a special format and will always be 160 by 160 pixels.
         myImage = new BitmapData(160,160);
         bytes.position = 0;
         try{
              myImage.setPixels(new Rectangle(0,0,160,160),bytes);
         } catch(e:EOFError){
              trace(bytes.position); //Outputs: 4628
         addChild(new Bitmap(myImage));
    As the comments show, though the ByteArray is 4631 bytes, it is only read up until byte number 4628. Then it throws an error. Any idea what's going on?

  • Help with loading multiple images via LoadVars

    Hello everybody.
    I need a hand loading multiple images using the LoadVars
    method with a text file. I can get it to load 1 image but not
    anymore than that. I am aware of other methods like using
    components but I am looking for a method where I can access and
    change all data from 1 text file (there will be text variable text
    within the file aswell to, but I am more concerned with the images
    at the moment).
    Anyway on to the issue. I have created a much simple .fla
    file that outlines my problem.
    The movie contains 3 layers:
    - top layer contains AS
    - middle layer contains an empty movie clip with the
    instance name of mcImage1
    - bottom layer contains an empy movie clip with the instance
    name of mcImage2
    The AS layer contains the following code:
    imagedata = new LoadVars()
    imagedata.load("data.txt")
    imagedata.onLoad = function(ok){
    if(ok){
    mcImage1.loadMovie(this.Image1)
    mcImage2.loadMovie(this.Image2)
    } else trace("Problem Loading")
    In the same folder of my .swf file I have a text file called
    data.txt which contains the following
    &Image1=image1.gif
    &Image2=image2.gif
    Also in the same folder of my .swf file I have two images
    image1.gif and image2.gif.
    When I run the flash the image2.gif is imported correctly.
    image1.gif does not appear.
    You can download my source files and all images here
    http://www.myrealpage.com/projects/var_test/var_test.zip
    Any help that can be shed on this problem is much
    appreciated.
    Thanks
    Matt

    Glad to help. It is just that I see so many folks who have
    two different parts of a problem smushed together – each
    problem isn't so hard on its own, but together they are difficult
    to wrap your head around. Always try and break down each step of
    the problem and it will help you in the end.
    That being said, I'm not quite so sure on this next problem.
    I don't do so much timeline stuff along with the Actionscript. I
    can get tricky. So this I don't quite have as much of clear mental
    picture of what you are describing. But here are some questions
    that I would ask – either of myself if I was doing it or of
    you.
    Is there a stop() on frame one to wait for the
    LoadVars.onLoad? Does the onLoad then say to play?
    If not, what happens if we get to Frame 10 before the
    LoadVars has even finished? That could be a problem.
    Remember that the LoadVars object is an actual object that
    will exist until it is deleted or removed in various ways. You can
    access it at any time after it is loaded. The onLoad event handler
    is just that thing you want to happen immediately after it is
    loaded.
    So my design would probably be.
    LoadVars on Frame 1.
    Where I am stopped.
    In the onLoad handler load the first image and tell the
    timeline to play
    On frame 10, the LoadVars object will still exist (unless
    you've deleted it)
    Get the variable out of the LoadVars and load the image.
    If you want to check this. Put a stop() in frame 10 and run
    it in the testing environment. When it gets to that frame, go to
    the debug menu and List Variables. You should see that your
    LoadVars object is still there.
    Does that answer your question or am I totally missing the
    point?

  • When loading the music application on iPhone 4s it has a iCloud symbol with a loading bar but isn't loading... any advise to help?

    When loading the music application on iPhone 4s it has a iCloud symbol with a loading bar but isn't loading... any advise to help?

    keith
    You have posted your issue in Using Apple Support Communities whose topic is 'How to use this forum software's interface, features and/or how to find what you wish'. It is a relatively low traffic and inappropriate forum for your problem. I will ask our Hosts to move it to Using IiPhone where it may get a more rapid response from your fellow users.
    ÇÇÇ

  • When I try to load an image from the scanner, or from a file, into a bank deposit script, I get a message - "Error Java heap space". Need help to diagnose and fix this problem.

    I am running a script from my banking facility which asks me to load an image of the front and back of the check. I never had a problem before, but this time when I try to load the images either directly from the scanner, or from previously saved jpg files I get an error window message that says - Error Java heap space,
    Ed Marcato

    I am running a script from my banking facility which asks me to load an image of the front and back of the check. I never had a problem before, but this time when I try to load the images either directly from the scanner, or from previously saved jpg files I get an error window message that says - Error Java heap space,
    Ed Marcato

  • (HELP) - Loading multiple external images error #1010

    I'm a newbie at Flash and spent the whole day trying to fix this one problem and can't seem to fix it no matter what I do.
    I'm using Action Script 3.0, CS5 on Windows 7.
    I'm trying to load two external images (thumbnail images) in the loader "see image below for reference", where the full image size will be. However, I am getting this error when testing my movie. What am I doing wrong?
    Test Movie error message:
    "port1_btn
    TypeError: Error #1010: A term is undefined and has no properties.
        at index_fla::MainTimeline/fl_MouseClickHandler_6()"
    "port2_btn
    TypeError: Error #1010: A term is undefined and has no properties.
        at index_fla::MainTimeline/fl_MouseClickHandler_7()"
    FYI:
    Loader instance name: mainLoader
    Thumbnail #1 instance name: port1_btn
    Thumbnail #2 instance name: port2_btn
    This is my code

    Go into your Flash Publish Settings and select the option to Permit Debugging.  Then the error messages could include an indication of which lines are causing the problem.
    And just for the sake of asking since the code is somewhat minimal... is the mainLoader inside a container named portfolioBkgd?

  • Need help loading base64 encoded image.

    I've got an applet that saves an image into a database by posting a base64 encoded version of the image to an ASP page. Basically, I convert the image to an array of bytes, then encode it and post it to the page. Now, my problem occurs after I read the base64 string from the database and try to display it. When the application is started up, it is supposed to read the image and load it into the canvas of the applet, but I get a NullPointerException when I call displayImage because the fgImage has -1 width and height. If anyone has done this before and has any hints or tips, that would be great. Otherwise, take a look at my code and see if you can find something wrong. Thanks!
    public void loadBase64Image(int[] newPixels) {
    System.out.println("loading new image...");
    try {
    if (newPixels == null) {
    byte[] imgPixels = new byte[this.getWidth() * this.getHeight() * 4];
    URL loadURL = new URL(fgImgURL);
    URLConnection imageCon = loadURL.openConnection();
    imageCon.setDoOutput( true );
    imageCon.setUseCaches(false);
    DataInputStream imageIn = new DataInputStream( imageCon.getInputStream() );
    BASE64Decoder decodedImage = new BASE64Decoder();
    imgPixels = decodedImage.decodeBuffer(imageIn);
    imageIn.close();
    int w = this.getWidth();
    int h = this.getHeight();
    int imgPix[] = new int[w * h];
    int index = 0;
    for(int y=0; y<imgPix.length;y++){
    imgPix[y] = imgPixels[4*y]
    | (imgPixels[4*y + 1] >> 8)
    | (imgPixels[4*y + 2] >> 16)
    | (imgPixels[4*y + 3] >> 24);
    imgMemSrc = new MemoryImageSource(w, h, imgPix, 0, w);
    else
    imgMemSrc = new MemoryImageSource(this.getWidth(),this.getHeight(),newPixels,0,this.getWidth());
    // Update the fgImage to the current OSC.
    if (fgImage != null) fgImage.flush();
    fgImage = Toolkit.getDefaultToolkit().createImage(imgMemSrc);
    displayImage(fgImage, this.getWidth(), this.getHeight());
    catch (Exception e){
    System.out.println("BASE64 LOAD ERROR (" + e.getClass() + ": " + e.getMessage() + ")");

    Docs for URLConnection
    "A URL connection can be used for input and/or output. Set the DoInput flag to true if you intend to use the URL connection for input, false if not. The default is true unless DoOutput is explicitly set to true, in which case DoInput defaults to false."
    You have setDoOutput(true), so doInput is by default set to false according to the docs. I would make the change to also setDoInput(true) as well and see if it works.
    public void loadBase64Image(int[] newPixels) {
       System.out.println("loading new image...");
       try {
          if (newPixels == null) {
             byte[] imgPixels = new byte[this.getWidth() * this.getHeight() * 4];
             URL loadURL = new URL(fgImgURL);
             URLConnection imageCon = loadURL.openConnection();
             imageCon.setDoOutput( true );
             imageCon.setDoInput( true ); // Make sure you add this line
             imageCon.setUseCaches(false);
             DataInputStream imageIn = new DataInputStream( imageCon.getInputStream() );
             BASE64Decoder decodedImage = new BASE64Decoder();
             imgPixels = decodedImage.decodeBuffer(imageIn);
             imageIn.close();
             int w = this.getWidth();
             int h = this.getHeight();
             int imgPix[] = new int[w * h];
             int index = 0;
             for(int y=0; y<imgPix.length;y++){
                imgPix[y] = imgPixels[4*y] | (imgPixels[4*y + 1] >> 8) | (imgPixels[4*y + 2] >> 16) | (imgPixels[4*y + 3] >> 24);
             imgMemSrc = new MemoryImageSource(w, h, imgPix, 0, w);
          else
             imgMemSrc = new MemoryImageSource(this.getWidth(),this.getHeight(),newPixels,0,this.getWidth());
          // Update the fgImage to the current OSC.
          if (fgImage != null)
             fgImage.flush();
          fgImage = Toolkit.getDefaultToolkit().createImage(imgMemSrc);
          displayImage(fgImage, this.getWidth(), this.getHeight());
       catch (Exception e){
          System.out.println("BASE64 LOAD ERROR (" + e.getClass() + ": " + e.getMessage() + ")");

  • Error While loading a image from database

    Purpose
    Error While loading the Image from the database
    ORA-06502: PL/SQL : numeric or value error:Character string buffer too small
    ORA-06512: at "Sys.HTP" ,line 1480
    Requirement:
    I am developing the web pages using PSP(Pl/sql Serverpages) . I have a requirement to show a image in the webpage. I got the following procedures from the oracle website.
    I have created the following table to store the images
    create table DEMO
    ID INTEGER not null,
    THEBLOB BLOB
    And I also uploaded the Images. Now I am try to get a image from the table using the following procedure .But I am getting the error message line 25( htp.prn( utl_raw.cast_to_varchar2( l_raw ) );) .at it throws the following error messages
    ORA-06502: PL/SQL : numeric or value error:Character string buffer too small
    ORA-06512: at "Sys.HTP" ,line 1480
    Procedure that I used to get the image
    create or replace package body image_get
    as
    procedure gif( p_id in demo.id%type )
    is
    l_lob blob;
    l_amt number default 30;
    l_off number default 1;
    l_raw raw(4096);
    begin
    select theBlob into l_lob
    from demo
    where id = p_id;
    -- make sure to change this for your type!
    owa_util.mime_header( 'image/gif' );
    begin
    loop
    dbms_lob.read( l_lob, l_amt, l_off, l_raw );
    -- it is vital to use htp.PRN to avoid
    -- spurious line feeds getting added to your
    -- document
    htp.prn( utl_raw.cast_to_varchar2( l_raw ) );
    l_off := l_off+l_amt;
    l_amt := 4096;
    end loop;
    exception
    when no_data_found then
    NULL;
    end;
    end;
    end;
    What I have to do to correct this problem. This demo procedure and table that I am downloaded from oracle. Some where I made a mistake. any help??
    Thanks,
    Nats

    Hi Satish,
    I have set the raw value as 3600 but still its gives the same error only. When I debug the procedure its throwing the error stack in
    SYS.htp.prn procedure of the following line of code
    if (rows_in < pack_after) then
    while ((len - loc) >= HTBUF_LEN)
    loop
    rows_in := rows_in + 1;
    htbuf(rows_in) := substr(cbuf, loc + 1, HTBUF_LEN);
    loc := loc + HTBUF_LEN;
    end loop;
    if (loc < len)
    then
    rows_in := rows_in + 1;
    htbuf(rows_in) := substr(cbuf, loc + 1);
    end if;
    return;
    end if;
    Its a system procedure. I don't no how to proceed .. I am really stucked on this....is their any other method to take picture from the database and displayed in the web page.....???? any idea..../suggesstion??
    Thanks for your help!!!.

Maybe you are looking for