Dim objBitmap as bitmap = new bitmap(ThePic.Width, ThePic.Height)
MakeGraphic(Graphics.FromImage(objBitmap))
objBitmap.save("c:\test1.jp,Imaging.ImageFormat.Jp eg)
J
"Charles A. Lackman" <Charles@cet.com> wrote in message
news:erIjPPzTEHA.4048@TK2MSFTNGP12.phx.gbl...[color=blue]
> Hello,
>
> Ok, I already have a sub that takes the graphics object
>
> Public Sub MakeGraphic(ByVal AGraphic As Graphics)
> e.Graphics.SmoothingMode = Drawing2D.SmoothingMode.HighQuality
> e.Graphics.DrawString(Line1.Text, FontLine1, TheBrush, Thelocation1, 390 +
> yPos, AStringFormat)
> e.Graphics.DrawString(Line2.Text, FontLine2, TheBrush, Thelocation2,
> TheHeight1 + (390 + yPos))
> e.Graphics.DrawString(Line3.Text, FontLine3, TheBrush, Thelocation3,
> TheHeight2 + (390 + yPos))
> e.Graphics.DrawString(Line4.Text, FontLine4, TheBrush, Thelocation4,
> TheHeight3 + (390 + yPos), AStringFormat)
>
> SaveBitMap = New Bitmap(ThePic.Width, ThePic.Height, e.Graphics)
> SaveBitMap.Save("C:\Test1.jpg")
> End sub
>
> To do the Graphics.FromImage(Bitmap) where is the Bitmap coming from?
> Doing the above makes a file with 88k or more but it is empty??
>
> Thanks,
> Chuck
>
> "James Westgate [Crainiate]" <james@nospam.crainiate.com> wrote in message
> news:OVjob7yTEHA.384@TK2MSFTNGP10.phx.gbl...[color=green]
> > Create a sub thats takes graphics as a parameter and put your drawing[/color][/color]
code[color=blue][color=green]
> > in it. For printing, pass the printer graphics object. For an image,[/color]
> create[color=green]
> > a bitmap and pass Graphics.FromImage(bitmap). You can then save the[/color][/color]
bitmap[color=blue][color=green]
> > etc.
> >
> > James
> >
> > --
> > Create interactive diagrams and flowcharts with ERM Diagram at
> >
http://www.crainiate.net
> >
> > Take the ERM Tour at
http://www.flowchartcontrol.com
> >
> >
> > "Charles A. Lackman" <Charles@cet.com> wrote in message
> > news:e2R6jdyTEHA.2408@tk2msftngp13.phx.gbl...[color=darkred]
> > > Hello,
> > >
> > > I have created a complete PrintDocument and need to create an image[/color][/color][/color]
from[color=blue][color=green]
> > it.[color=darkred]
> > > How is this done?
> > >
> > > e.Graphics.SmoothingMode = Drawing2D.SmoothingMode.HighQuality
> > > e.Graphics.DrawString(Line1.Text, FontLine1, TheBrush, Thelocation1,[/color][/color][/color]
390[color=blue]
> +[color=green][color=darkred]
> > > yPos, AStringFormat)
> > > e.Graphics.DrawString(Line2.Text, FontLine2, TheBrush, Thelocation2,
> > > TheHeight1 + (390 + yPos))
> > > e.Graphics.DrawString(Line3.Text, FontLine3, TheBrush, Thelocation3,
> > > TheHeight2 + (390 + yPos))
> > > e.Graphics.DrawString(Line4.Text, FontLine4, TheBrush, Thelocation4,
> > > TheHeight3 + (390 + yPos), AStringFormat)
> > >
> > > Dim AnImage as Image
> > >
> > > AnImage = CType(e.graphics, Image) does not work.
> > >
> > > Any Suggestions?
> > >
> > > Thanks,
> > >
> > > Chuck
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]