Re: Convert picture box content to jpeg??
- From: Randy Gardner <RandyGardner@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 18 Sep 2008 09:38:05 -0700
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
- Follow-Ups:
- Re: Convert picture box content to jpeg??
- From: Steve Barnett
- Re: Convert picture box content to jpeg??
- References:
- Convert picture box content to jpeg??
- From: Randy Gardner
- Re: Convert picture box content to jpeg??
- From: Steve Barnett
- Convert picture box content to jpeg??
- Prev by Date: Re: Simple class diagramming tool for VB6
- Next by Date: Re: Convert picture box content to jpeg??
- Previous by thread: Re: Convert picture box content to jpeg??
- Next by thread: Re: Convert picture box content to jpeg??
- Index(es):
Relevant Pages
|
Loading