How to get image RGB/16???????? (cont)

VRect currentRect;
int32 progressTotal = tilesVert * tilesHoriz;
int32 progressDone = 0;
// process each tile in order
currentRect.top = 0;
currentRect.left = 0;
currentRect.bottom = tileHeight;
currentRect.right = tileWidth;
// don't go past the document bounds
if (currentRect.bottom > docHeight)
currentRect.bottom = docHeight;
if (currentRect.right > docWidth)
currentRect.right = docWidth;
pixelMemoryDesc.rowBits = (currentRect.right - currentRect.left) *
readChannelDesc->depth;
// read
while(readChannelDesc != NULL)
bigError = sPSChannelProcs->ReadPixelsFromLevel(
readChannelDesc->port, 0, &currentRect, &pixelMemoryDesc);
if (bigError)
error = filterBadParameters;
throw(this);
unsigned char *imageData;// for image RGB/8, with RGB/16 is unsigned short
long temp = tileHeight * tileWidth * readChannelDesc->depth/8;
imageData = new unsigned char[temp];// for image RGB/8, with RGB/16 is unsigned short
memcpy(imageData, pixelMemoryDesc.data, temp);
FILE *file;
file = fopen("C:\\abc.txt", "ab");
if(file == NULL)
return;
fwrite(imageData, sizeof(unsigned char), temp, file);// for image RGB/8, with RGB/16 is unsigned short
fclose(file);
readChannelDesc = readChannelDesc->next;
return;
////end of customizing/////
- then we use a project to read "abc.txt" to get image:
////////// function of button that is clicked, the image is shown
void CPixelDlg::OnBtnSetPixel()
// TODO: Add your control notification handler code here
// POINT point;
unsigned char*memblock;// for image RGB/8, with RGB/16 is unsigned short
memblock = new unsigned char[HEIGH * WIDTH *3];// HEIGH , WIDTH is assigned by hard code// for image RGB/8, with RGB/16 is unsigned short
FILE *file;
file = fopen("C:\\abc.txt", "rb");
if( file == NULL)
return;
else
fread(memblock, sizeof(unsigned char), HEIGH * WIDTH *3, file);// for image RGB/8, with RGB/16 is unsigned short
fclose(file);
CClientDC dc(this);
int i = 0;
int j=0;
int k = 0;
for( i = 0; i < WIDTH; i++)
for( j = 0; j < HEIGH; j++)
if (k>WIDTH*HEIGH*3-3)
break;
dc.SetPixel(j, i, RGB(memblock[k],memblock[k+WIDTH*HEIGH],memblock[k+2*WIDTH*HEIGH]));
k+=1;
2. that code is ok for Image RGB/8. But with image RGB/16, now we don't know how Photoshop stores image data, and how to get image data to show???
Please help me?
Thanks,

Use ResultSet.getBinaryStream()

Similar Messages

  • How to get image using Http and how to save in Smulator

    Hi guys,
    Am working in black berry bold. i dont know how to get image using htp connection and one more thing i need to save this image in side simulator directory............. what are the specific API i should...
    Guide me.........

    If you want the input image size you need to pass it in as parameters.
    A discussion thread on this topic is:
    http://forums.adobe.com/thread/29948
    -- Daniel R. <[email protected]> http://danielr.neophi.com/

  • How to get the RGB value of each pixel of a hole image?

    Hi,
    I'm trying the get the RGB(between 0 and 255) value of each pixel of a hole image. I writte this code:
    public void convertImage()
         int w = bufferedImage.getWidth();
         int h = bufferedImage.getHeight();
         int[] rgbs = new int[w*h];/* create a new array */
         bufferedImage.getRGB(0,0,w,h,rgbs,0,w);
         for(int i=0; i<10; i++)  
             System.out.println(rgbs);
    But the value rgbs[] contain an 8 bits integer, it's possible to have the RGB of this.
    In other case, do you have another sample of code to help me to get the RGB value of each pixel of a hole image?
    thanks.

    Hi, I am currently working on an application which requires the generation of color histograms that are a representation of a given image ie; myImage.jpg. I have made use of the JAI API and used it's Histogram class to generate a histogram vector for the image that I provide.
    However, upon closer inpsection, I have realised the following:-
    (1) The image, as it contains multiple colours is a multi-banded image ie; this means that each individual pixel in the image contains multiple colour samples (I assume) ie; Red, Blue Green. Due to this, a "separate list of bins represents each individual band". This means that for myImage.jpg, there is not ONE individual vector that contains data such as "400 pixels purple" "5000 pixels yellow" etc but there are indeed 3 vectors that represent the image.
    I have found this to be true using the getBinSize(int band, int bin) method call - the first parameter being 0,1,2 for Red Blue or Green.
    My basic (or complex) problem is that I basically want to generate 2 color histogram vectors that represent 2 separate images and then compare these vectors "side-by-side" using the vector comparison algorithms that I have already developed.
    Is there a way of using Java's Histogram class and it's associated methods to be able to store all colour information for an image in only ONE vector?? I am pretty certain that this is not possible, so my dilemma is now: - If I have an image and it is represented by three separate vectors/histograms, then how can I possibly compare these to say whether an image matches or not.
    When a pixel is analysed by a program, what seems to be the result returned is how that pixel is made up in terms of Red, Green or blue ie; a purple pixel is X blue, X red and X green and hence 3 vectos existing.
    Can anybody offer advice on how to achieve this task of looking at a pixel and simply determining it's actual color. I would preferably like to keep my code that I have already developed ie; the use of the Java Histoogram class but any other offerings are appreciated.

  • How to get image properties in PDF using javascript or plug ins

    Hi
    How to get the image(all the images) properties in PDF using javascript or suggest plug ins
    Thanks in Advance

    HI,
    In the PDF Edit API's ( as has already been suggested) there is the PDEImage and using this you should be able to find out everything you need to know about any image in a PDF file.
    I would recommend starting with PDEImageGetAttrs
    Hope this helps
    Malcolm

  • How to get image properties in PDF using javascript

    Hi
    How to get the image(all the images) properties in PDF using javascript?
    Thanks in Advance

    Hi
    Thanks for your quick response. Any recommended plug ins
    Thanks in advance

  • How to get images dynamically from database without file paths in the table field

    I have a MS-Access database. I am working with ASP.NET. In the database there is product table in which I have "CodeNo" as a field which is a text field, and the product codes like "SM-R-2035". I also have another field "Image" which is also a text field and which have a file path in it corresponding to the particular product Image (e.g. Images\Products\SM-R-2035.jpg). So far every thing is ok. I have to update this site very frequently and lots of images are added each and every time. Its a tedious work to type the paths and file name every time and it also take a lot of time.
    What I am asking is : Is it possible to get images from a specific folder at runtime which is referenced by the "code no" itself and not the file path from the database. (Say at run time the "code no" is referenced from the database and the corresponding image is loaded dynamically from the specified folder). In other word I want to avoid the tedious work of typing.
    Can any one help with this issue. Any other simple suggestions are welcome.

    All you need to do is simple concatenation to obtain the path for the image file.  You didn't mention whether you are using VB.Net, C# or some other language to do your coding.
    If the code in your database is SM-R-2035, the file name is SM-R-2035.jpg and the path to the images foilder is Images\Products\SM-R-2035.jpg, Conceptually here is what you need to do:
    dim code_var
    dim path_var
    code_var = the code you obtain from your relevant field in the database
    path_var = "Images\Products\" & code_var & ".jpg"
    Now path_var is what you would call to obtain the image from your images folder.

  • How to get Image size?

    Hello,
    I need help for getting Image size, when i am using JAI.
    for example:
    RenderedImage img = JAI.create("url", url);
    If you could help me than please.
    Thanks
    bye
    Jarrar.

    img.getHeight();
    img.getWidth();

  • How to get image size in bytes

    i have to get image size in bytes and accessing image from the a folder
    Thanks in advance

    If it's going to be accessed as a file on the filesystem, you can use java.io.File.length() to get the size in bytes.
    In other situations...it depends on what you're doing.

  • How to get the RGB Working Space from within a Filter Plug-In?

    Within my Filter Plug-In I need to access the image's icc profile data. I know this can be accomplished with the according data structure 'iCCprofileData'. But what if there is no profile assigned to the image? Then iCCprofileData is NULL and the default should apply which is the 'RGB Working Space' (assuming the Plug-In works in RGB mode only, what it does). But how can I get to know what the 'RGB Working Space' is from within my Plug-In?

    As far as I know, the profile provided to the plugin API should never be NULL. If the image is not color managed, it still should have the working space profile in the ICCProfileData field.

  • How to get image format

    If i have a Image object or BufferedImage , how can i get it's original image format?

    But in some cases, if user put an image to
    application, when we export the image to a file , the
    user want to see the same format image file.i agree, you're right
    Of course, we can remember the format when user
    select the image, and pass it to export module or
    read the bytes from bufferedImage to determine format
    by the start bytes. yes, you can keep track of the format
    I don't think the two ways are perfect, i don't want
    change other modules many codes to remember the image
    format, so I want to get a good way to judge the
    format from image or buffedImage objectwell, at runtime this will be difficult/impossible, at least for some/most images

  • How to get Image from JEditorPane

    I have an HTML which is rendered in JEditorPane. I need to get the image, shrink it, and create an icon. any idea how to do this?
    Thanks

    You can call the component's paint method and supply another Graphics object for it to paint to. Then use this Graphics object as your Icon's paint buffer...
    Quick ugly pseudocode...
    tempGraphics = createImage(...).getGraphics();
    pane.paint(tempGraphics); //ok now you have the image.
    //scale it...
    Icon icon = new Icon(){
    public void paintIcon(Component c, Graphics g, int x, int y)
    tempGraphics.copyTo(g);
    };

  • How to get Image Coordinates in a Frame

    Hi,
    I want to retrieve Image Coordinates contained in a Frame.
    I am able to get the frame coordinates through IGeometry but not the images.
    Any help will be highly appreciated.
    Regards,
    Rahul Rastogi

    Hi
    SnpGraphicHelper in SDK provides code for getting IImageDataAccess for given Frame ref. Use GetUID to get uid of the image from IImageDataAccess, obtained above.
    Once you get UID, you should be able to get its geometry.
    Rajani

  • How to get images to show in browsers after upload Muse 4

    After installing the new Muse 4 I uploaded my new site. None of the images show up in any browser I have. How do I solve this problem. www.lindabrewster.com
    Thanks
    Linda

    It appears you figured it out as the images appear fine at your site.
    Thanks,
    Vinayak

  • How to get image filename in indesign cs3

    Hi,
        I want to get a filename of a selected rectangle frame graphic child item like tiff image or pdf file. Please help me with a code snippet.
    Thanks,
    K.Saravanan.

    app.activeWindow.activeSpread = myDocument.spreads[j];
    app.activeWindow.zoom(ZoomOptions.FIT_SPREAD);

  • How to get image from MIME folder

    Dear Experts!!
    I am doing the WebDynpro Exercise on /docs/DOC-8661#22 [original link is broken] [original link is broken].
    I put the images files to be shown with the UI elements in srcmimesComponents<package folder> in my workplace, gave the source of the pictures in the layout setting of the UI elements.
    However, I am not getting the images in the UI elements.
    I want some hints on the place to put the image files.
    I have put the images in the above mentioned folder  of the workplace, but when I check the navigation view of the project, I cannot see those imagefiles in srcmimesComponents<package folder>.
    Thanks in advance for your suggestions.
    regards,
    sudeep

    Hi Sudeep
    The procedure you are following in copying the images into src\mimes\Components\<package folder> is absolutely correct, but you are saying that you are not able to see those in navigation tab, then do one thing . directly nagivate through the 
    src\mimes\Components\<package folder> in your navigation tab and try to paste in image there only.
    remember one thing. the image name is CASE SENSITIVE . and you need to specify the extension along with the image name in the SOURCE property of the ImageUIElement.
    CLOSE YOUR PROJECT AND REOPEN THE PROJECT . and then go through navigation tab and see. now you can see those images
    Best Regards
    Chaitanya.A

Maybe you are looking for

  • Instruments from jam packs are not there after new install

    hi, i ve been using all jam packs instruments in my GB2 last year on my imac without any problems. i have them all at my external FW drive since then, and never at my internal. ( i usually dont use "loops" at all, i prefer instruments ) so, i install

  • Problem in BEx.

    It is not possible to use the colour pale blue in any workbook with a BEX query in it! As this is the corporate colour for all our reporting it’s getting messy moving all presentational tables into new workbooks. thanks.

  • Oracle 10g - Introduction to SQL  course question

    Two years ago I completed the Oracle 9i - Introduction to SQL course. An complete the #1Z0-007 exam and pass with almost 100%. I notice that Oracle 10g - Introduction to SQL courses are now being offer. If I have already done the Oracle 9i course and

  • Error Download() failed. 80072efe.

    hello i have a problem deploying a OS( win 7 sp1 ), always error Download() failed. 80072efe. SendWinHttpRequest failed. 80072efe. my SCCM ( 2012 r2 cu2 ) is in miami and the clients/pc are in the  El salvador. i have two local DP and the same proble

  • Disappearing Subform

    I've created an interactive dynamic form that shows or hides subforms based on a selection from a drop-down menu. The drop-down menu has 10 "List Items" and each List Item has a corresponding subform. Each subforms presence set to "Hidden (Exclude fr