Re: Convert picture box content to jpeg??



Steve:

I'm certianly not the sharpest tool in the wood shed, however, I downloaded
from the website and ran the .vbp, nothing happens?

I see grapes in 2 picture boxes but redraw does nothing?
I tried changing parameters, color, pixels, etc.

Did I miss somethng?
--
Thank you,

Randy


"Steve Barnett" wrote:

You might want to go have a look at:
http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=43004&lngWId=1

This describes the GDI+ functions and provides a sample app that does most
things you'll ever want to with GDI+. I adapted this code to save a picture
box to a png file, precisely for use on web pages. The relevant bit of code
comes down to:

'*** Initialise the graphics class based on the picture box with the dial
in it
Call GdipCreateFromHDC(picDial.hDC, Graphics) ' Initialize the graphics
class - required for all drawing

'*** Create the image "class" from the image in the picture box
PictureBox
Call GdipCreateBitmapFromHBITMAP(picDial.Image.Handle,
picDial.Image.hPal, img)

'*** Get the CLSID of the PNG encoder
encoderCLSID = GetEncoderClsid("image/png")

'*** Now save the file as a png. There are no parameters for png files
encoderParams.Count = 0
stat = GdipSaveImageToFile(img, fileName, encoderCLSID, encoderParams)

There are a few initialisation jobs to do as well as this, but they're all
covered in the sample files. I have to say, the results I obtained were
excellent (I also used GDI+ to write to the picture box, so got anti-alias
support).

You also have options for gif and jpeg files, if you prefer that format.

Steve


"Randy Gardner" <RandyGardner@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B3086140-ADB7-4D65-B1E9-C3CCF4B11E83@xxxxxxxxxxxxxxxx
I want to take data (text & graphics) from a picture box and convert it to
a
jpeg for display on a website. HOW?

Is there a size issue, picture box and website display window?


--
Thank you,

Randy



.



Relevant Pages

  • Re: Cursor movement
    ... Thanks Pat. ... launch a new mystery website. ... learned in Publisher. ... the side of other picture instead of below. ...
    (microsoft.public.frontpage.client)
  • Less is more [Re: Sage, the music at you web page]
    ... to "simplify" a website as far as is possible, without, of course, ... it's just a simple fact - that all good film directors and so ... there's that clever camera "effect" in films where they start ... "graphical menu" because you click on parts of the picture to navigate ...
    (alt.lang.asm)
  • [OT -- Like Way OT] Opportunity for a Merry Prank
    ... A commercial firm has linked to a picture in my website as an example ... or potential customers. ... adult specimen of [xxx plant], click here [linked to a file in my ...
    (rec.arts.comics.strips)
  • Redone, by Jeff - Now with Titles & Captions! - Re: Donkey Pics
    ... I mentioned in that Reply that we found that Net Objects Fusion ... >> can actually do the Picture Gallery ... I presumed that it was on the WebSite that you include in your Sig? ...
    (uk.people.silversurfers)
  • Re: Save Text as a picture
    ... Right click over box and select 'Save as picture'. ... Still have the same problem when saving as a png file. ... I want to save the text only with a clear or invisible background ...
    (microsoft.public.publisher)

Loading