Encode PBYTE and save as a jpg

I am trying to make an encoder using WIC and replace the old encoder of an application. I could manage to decode and encode using file, but I need to to do that to the bitmap data which is in PBYTE type. I referred msdn and try to use stream still don't
understand how could i do that.
Can anyone show me the steps should i follow.
this is how i tried to do it:
PBYTE pBitmap, // coming as a parameter 
/* Create Com imaging factory */
if (SUCCEEDED(hr))
/* instance with a helper */
hr = CoCreateInstance(
CLSID_WICImagingFactory,
NULL,
CLSCTX_INPROC_SERVER,
IID_PPV_ARGS(&piFactory)
if (SUCCEEDED(hr))
hr = piFactory->CreateStream(&piStream);
if (SUCCEEDED(hr))
DWORD imageFileSize = lHeight * DIBWidthByte;
hr = piStream->InitializeFromMemory(
reinterpret_cast<BYTE*>(pDst),
imageFileSize);
// Create a decoder for the stream. and this gives error (component not found)
if (SUCCEEDED(hr)){
hr = piFactory->CreateDecoderFromStream(
piStream, // The stream to use to create the decoder
NULL, // Do not prefer a particular vendor
WICDecodeMetadataCacheOnLoad, // Cache metadata when needed
&piDecoder); // Pointer to the decoder
From here i was intended to do encoding part as i did using a file. still failed to create a decoder. (or can I just skip the decoding part sins I have image data as PBYTE) 
sorry if I bein silly. Pleas help.

I right click and choose save image

Similar Messages

  • Best way to Export and Run a CS2 action/plug-in and save to a JPG?

    Can someone help me with this? I am new to actions and droplets and LR/CS2 for that matter. :) sorry if this is basic beginner questions.
    Please let me know if this is not correct?
    * My assumption is I will get the best quality if I Export as a PSD,16-bit,300ppi file and then run my CS2 Plug-in and action ... then save to a JPG?
    If this is true ... this is my question.
    1) In LRv1 ... how do I Export the file as a PSD 16-bit ... and have a Action/droplet that will ultimatly save a JPG for me ... in another folder labled JPG?
    (prefer not to have a bunch of psd files that I have to go back and delete.
    2) p.s. I also would like to know I can do the same thing ... but this time configur my Action/droplet to save a "minimize embedded metadata' sRGB, constrained to 800px ... "save for WEB" JPG ... in a folder named WEB.
    3) The key question here "I guess" is when Exporting from LRv1 .. and running a action on LR Export ... Do I have to Export the "Same" type/size of file I plan to End up with???
    * So, If I want to end (after the action/droplet) with a 800x600 sRGB I need to Export it that way ...then LR will Run my Plug-in,& Sharpening Action on a smaller , lower bit file?
    Thank you all, who have helped me on LR
    * I am "trying" to automate LR ... my hope is true time savings :)

    I've used JSmooth to make exe file from jar file, and it worked good. It was so along ago though I can't recall how to use it anymore.
    Here's an example how to make a jar file from command line
    http://forum.java.sun.com/thread.jspa?threadID=740310&messageID=4246794#4246794
    There are plenty of others that can be found by using the search.
    kari-matti
    Message was edited by:
    kari-matti

  • Iphoto how to combine 2 photos and save as one jpg

    For real estate, on occasion would like to have large photo with smaller inset photo.  Need to then save as one JPG to send for advertising.
    I have iphoto and imovie. Thanks.

    Any of these can do what you want.  If you have iWork you can use Pages do to what you want.
    Some Image Editors That Support layers:
    Photoshop Elements 11 for Mac - $79
    Rainbow Painter - $30
    Imagerie - $38
    Acorn - $50
    Pixelmator - $60 
    Seashore - Free
    Portraits and Prints - Free
    GIMP for Mac - Free
    Xee 2.1 - free
    Opps, didn't see Larry's reference to lower case pages.
    OT
    Message was edited by: Old Toad

  • How do you grab an image on the web and save as a jpg when it only has a link?

    Recently Yahoo Groups has gone to identifying all photos with a link. I used to be able to drag the photo to my desktop as a jpg and putin IPhoto. Now, it only lets me drag the link to the photo on the page. Is there a way to capture the image as a jpg? Thanks in advance for any help.

    I right click and choose save image

  • How take snapshot of the screen and save it as jpg

    Dear Friends,
    I need to take some snapshot of the screen but i want to move with the mouse a square and then resize the square to define the area to take snapshots .... i would like to take a snapshot for example every second or less and saved as jpg with a name x and then replace the x with the next snapshot ... x.jpg (always) ...
    How can i start ...what classes can i use , please help me ...

    Java 1.3 introduces a class java.awt.Robot, which includes a method
    public BufferedImage createScreenCapture(Rectangle screenRect)
    Java Advanced Imaging is downloadable for Java 1.3, or included in Java 1.4, and includes codecs for reading and writing images to and from files in various formats, including jpeg... there should be examples in the download.
    The part where you may find trouble is drawing a rectangle with the mouse to define the area to take snapshots - you cannot track the mouse outside the area of your application, so cannot draw an area to capture unless it is entirely within your application Frames/Windows. It may be possible to create a fullscreen transparent window to track the mouse, but this will interfere with the operation of the desktop while it is displayed... which may be desirable to be able to draw the capture area.

  • Capturing Screen and save it as JPG

    I'm making an exe with flash that will go on CD and what I
    need is to capture the screen so the user can save the image and
    send it by email. I've seen that you can capture an image using php
    but my project will go on CD. Is it possible or I should explain
    the user how to printScreen on Windows...
    Thanks!
    Marta

    If you just want to capture what is on the entire Flash stage
    then you can use the Bitmap class in Flash 8. If you are trying to
    capture items outside of Flash then the answer is no, unless you
    find a third-party tool to use.
    Tim

  • How to resize a .jpg to a specific size, and save in new location

    Basicly what im doing is placing an image that the user has into a database, turning it into a specific size. They are all going to be .jpg files from begining to end. The user gives the location of the image, and i would like the image resized to a fixed size, 260x120, and then save that image into a directory already created, and save as a .jpg . How would I go about doing this?? any help would be appreciated.
    Thanks,
    Mark

    In addition to Irene's solution (that I believe require the Vision toolkit) the is also the G-Toolbox that will do this without Vision. I think Georege Zou sell a license for less that $50.
    I may have heard this is built into LV7 but I am not sure (I am still finishing off an app in 6.1, so I have not opened that box yet).
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Problem with save as .jpg once edited in LR5 and sent to PSE11 to save as a .jpg

    Several days ago I bought Lightroom 5 as I have recently started taking pictures in RAW.  I love the process and how it works, pictures look wonderful.  I use Blurb (BookSmart) to create a yearly book which I am in and out of all year long.  When I edit a RAW picture in PSE 11 and save as a .JPG I can export my picture to Blurb.  When I edit my picture in LR5 and send to PSE11 to save as a .jpg I can not export my picture into Blurb.  Does anyone have a reason,? 

    Sorry - I am learning
    - In Lightroom after I have completed my development of the picture I
    1.  Right click on the picture and select "Edit in"  I select Edit in Adobe Photoshop Elements Editor  I then select in "edit a copy with Lightroom adjustments"
    2.  The picture will eventually open in PSE as a PSD
    3.  If I am making more adjustments such as the "spot healing" which I like better in PSE  -  I select the spot healing brush - I select the area needing fixing - click on the spot and make the correction
    4.  Once I have finished with any edits I might make in PSE I select "File" - Save As  and select Save As .jpg
    5.  The file at this point has been saved as a .jpg
    6.  In BookSmart (Blurb) I click on their icon for get photos
    7.  I select the file and the photo I want
    8. I select open
    9.  At this point nothing happens - in normal circumstances once I have selected Open - the picture will upload into Blurb (I would normally see the picture upload).
    If I do not use Lightroom and open the CRS file in PSE instead
    1.  I open the file with file open select photo which opens picture in PSE
    2.  Photo will open in the RAW editing program within PSE
    3.  I will make any adjustments I want to make
    4   I will select "open Image" in the Raw plug in
    5.  The picture will open within the PSE editor
    6.  I will again make any adjustment I might want to make within PSE editor such as the spot healing
    7.  When finished edits I select Edit - File Save As - select .JPG
    8.  As above in Booksmart I select "Get Photos"  - select the photos I want from the file
    9.  Select open
    10.  I will see the picture upload into Booksmart
    11.  The picture is ready to put into the book on the page I want.
    I do hope this is what you want - thanks

  • Catch the image of JTree and save it as a file

    There is an JTree and it has a few nodes.
    And there, I want to capture both the image of JTree and
    the images of it's child nodes as they show in screen.
    if possible, I want to capture image of all expanded nodes in tree and
    save them as jpg file.
    I try to capture the Image of JTree from JTree.createImage() method.
    and I also tried to capture the images of child nodes
    from JTree.getComponents() and capture images all of child nodes as they were.
    I,however,get to know the method
    Component.createImage() doesn't return the image that shows in screen as it was.
    could anybody tell me the answer?

    Hi,
    don't know if I got you right, but what you want is a "screenshot" of the JTree, right ?
    Try to paint the JTree in a BufferedImage and encode this as JPEG or whatever.
    BufferedImage theImage = new BufferedImage(
          owner.getWidth(), owner.getHeight(), BufferedImage.TYPE_INT_RGB);
          Graphics g = theImage.createGraphics();
          g.setClip( 0, 0, owner.getWidth(), owner.getHeight());
          owner.paint( g);owner is your JTree or any other component you want.
    Hope that helped.

  • How do I create an action that saves files as JPG in the same folder?

    Hey folks!
    So I'm sitting at work, trying to optimize my workflow a bit..
    What I'd like, is a droplet, that will allow me to open PSD's and save them as JPG in a new folder inside the original folder.
    Like the Image Processor that makes a new folder named 'JPG' but without opening the dialog box and having to press buttons.. Drag-drop-done
    Sitting on Imac with OS X 10.10.2 with Photoshop CC 2014.
    Hope you can help
    Regards
    Emil Rye

    Use scriptListener to create the code for adjusting the hue.  find the line in the code that denotes the change in hue replace that value with a variable that stores a random number:
    var rangeForRandomNumber = 200
    var offsetForRandomNumber = -100
    var randomNumber = Math.random() * rangeForRandomNumber + offsetForRandomNumber

  • Get image from Excel as shape and Save as .jpg

    Hello,
       I'm fairly new to ActiveX and am having a hard time doing a seemingly simple thing: getting a named image from an Excel file and saving it as a .jpg.  I have seen similar things done for Excel chart objects, but as I understand it images are "shapes" in Excel and I've been unable to find the right method to extract a shape. Please, if anyone could take a look at the attached folder and tell me if I am on the right track, if there is a better way to do this, or if there is a way to do this at all, it would be helpful.  Note that I don't care how efficient a strategy is developed - if I need to save to an intermediate file of another type, that's fine. The only goal is to be able to extract this image and save it with one mouse-click and no manual intervention.
    Folder contains: 1 example Excel file containing the image named "Picture 1"; 1 vi showing the method I've found for exporting Excel charts as .jpg's; and 1 vi with the progress I have made so far trying to pick the image from the Excel file and save it as a .jpg.  
    Thanks in advance!
    Megan
    Solved!
    Go to Solution.
    Attachments:
    GetExcelPicture.zip ‏70 KB

    Hi megan,
    see this link.
    Hope it helps.
    Mike

  • Close ALL open files and save jpg with jpg option

    Hi,
    I have some (a lot) of -jpg images to crop, and resize, while I have to do this one by one based on what portion of the image to crop, once done I need to close, and save them.
    To speed up the process I open several files, and do the crop&resize, and when finished I use "close all", and would like to avoid to confirm the "save" dialogue, and the "jpeg options" "image quality option" dialogue, having to say save, and the option set to a given value.
    Unfortunatelly I am not a coder, and didn't understand anything from the Javascript Scripting Reference guide.
    I found this
    app.docRef.close(SaveOptions.SAVECHANGES);
    here, I pasted it into ExtendScript, saved it, but when opening the script from file > scripts > browse it returns error 21 (undefined is not an object)
    Will you please kindly give me the script?
    Thank you

    Add this snippet to a script file.
    Load script file in PS scripts folder
    Restart photoshop
    Assign keyboard shortcut to script
    #target photoshop
    //Make Photoshop the formost Appplication
    app.bringToFront();
    // Requires at least one open document
    while (app.documents.length > 0)
         //Save all open windows
        {activeDocument.close(SaveOptions.SAVECHANGES);}

  • Photoshop Elements 13 crashes my Windows 7 PC every time I edit and try to save a panorama jpg created on a Samsung Galaxy S5 camera phone.

    Photoshop Elements 13 program crashes every time when using my Windows 7 PC to edit and try to save a panorama jpg created on a Samsung Galaxy S5 camera phone.
    However, Photoshop Elements 11 will perform and save the edits OK. What is wrong with version 13?

    Hi,
    Can you please share the logs?
    You can use the Adobe  Log Collector tool (Log Collector Tool) and share the corresponding zip file @ [email protected]
    Thanks,
    Shikha

  • With Netscape all of the Webcam shots from live feeds were automatically saved in my cache folder and I could simply open my cache send the saved files into AcDsee and convert them into jpgs, It would save as many as I would allow space for. With firefox

    I cant retrieve my images from webcams that are cached any more with mozilla. With netscape all of the live webcam images from live cams were automatically saved in my cache folder and all i had to do was open it send the files to acdsee and turn them into jpgs. It would save them untill the Cache ran out of room no matter how many files or sites I had running. Mozilla seems to save what it wants when it wants and often dose not save any that I can retrieve because I believe it is bulking them into Cache 123 or 4 and those i cant open to retrieve the files. Sometimes it saves 100 or so and sometimes 2 or 3 sometimes 10 or more but i don't seem to have any control over what it does or does not save to retrieve no matter how much space i allow for the cache to save.
    == This happened ==
    Every time Firefox opened
    == I finally gave up trying to keep netscape due to all the ridiculess popups and continued reminders from you saying i had to switch over

    You have or had an extension installed (Ant.com Toolbar) that has changed the user agent from Firefox/3.6.3 to Firefox/3.0.12.
    You can see the Firefox version at the top and the user agent at bottom of the "Help > About" window (Mac: Firefox > About Mozilla Firefox).
    You can check the '''general.useragent''' prefs on the '''about:config''' page.
    You can open the ''about:config'' page via the location bar, just like you open a website.
    Filter: '''general.useragent'''
    If ''general.useragent'' prefs are bold (user set) then you can right-click that pref and choose ''Reset''.
    See [[Web sites or add-ons incorrectly report incompatible browser]] and [[Finding your Firefox version]]
    See also http://kb.mozillazine.org/Resetting_your_useragent_string_to_its_compiled-in_default

  • Editing in external editor: Save back as JPG and (auto-) add to library

    I want to use external edit (in my case: Adobe Photoshop Elements) for editing features not available in LR3 (for example: skew) and easily save back as JPG. The source in LR3 is a DNG-image.
    LR3 offers easy workflows out-to-external-editor>back-to-LR3 if you save back as TIFF or PSD.
    But, I didn't find any easy or not extremely clumsy way to saving the edited photo back as JPG to LR3 and having it organized "close" to the original/source-DNG (preferably stacked).
    Any ideas out there?

    Thanks for the suggestion! If have taken your answer to dig into my problem for just another time - with positive result.
    The 'save as TIFF file' option in PSE after image export from LR opens a detailed dialogue box offering amongst others 'jpg compression' within a TIFF-container (never realized this before, never heard about this concept, my fault). So my goals are met: Having an efficient process to finetune some images in PSE, having the results automatically stacked in the LR library module and having a considerable lower file-size footprint as compared to e.g. Photoshops native or TIFF with zip compression.

Maybe you are looking for

  • K8NGM2-FID w/6150 nvidia video no signal thru DVI

    I just bought my Viewsonic 20" wide display LCD monitor. I am getting a "no Signal" message when I try to connect to the DVI. Regular analog works great in fact everything works great ecept the DVI adapter. Any suggestions? MY build AMD Athalon x64 X

  • Dynamic Text in Child SWF

    I created a tool tip symbol and corresponding class that follows the mouse cursor. The tool tip works fine when the swf that it lives in is run by itself. When I load that swf as a child, the dynamic text won't work. The tool tip clip appears and fol

  • Range from columns based on list of values

    Hi, I have a table that has a key_code and a alt_code like this with values like so.. (has 2 million records in 8.1.7 Database) KEY_CODE ALT_CODE 0001     AA 0001          AB 0001          AF 0001          G4 0001          G5 0001          G6 0200   

  • Finite pulse train with different frequency

    Hello, I'm trying to modify the labview example "generate finite pulse train" to generate a finite pluse train with different frequencies. Each freq will run 400 pulses. The freqs are stored in an array, which is being fed into a for loop. Thus ramp

  • Sales Order Fields

    Hi All We have a situation where we have Key account customer that fax their Purchase Orders to us with a price. The Credit Sales Ord Type we have designed forces user to populate this amount into this field when capturing the Sales Order for the cus