Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GDIPlusX and Printing
Message
From
03/04/2007 04:54:56
 
 
To
30/03/2007 17:44:14
General information
Forum:
Visual FoxPro
Category:
VFPX/Sedna
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
01210581
Message ID:
01211583
Views:
25
>Hi Sergio,
>
>Of course Yes ! You can Print your images.
>
>Method:
>ToPrinter(tlFitToPage, tcPrinterName, tnOrientation)

>2 - Without the image Canvas, you can create images on the fly, and print them.
>
>This short sample performs the following actions:
>
>Creates a 150x150 image,
>Draws the background in red,
>Draws a yellow circle in it,
>Draws a white string
>Prints the image
>Saves it to the disk
>Shows image in the web browser
>
>
_SCREEN.AddProperty("System", NEWOBJECT("xfcSystem", LOCFILE("system.vcx","vcx")))
>
>WITH _SCREEN.System.Drawing
>
>* Create a new Bitmap
>LOCAL loBmp as xfcBitmap
>loBmp = .Bitmap.New(150,150)
>
>* Create a Graphics object associated to the bitmap
>LOCAL loGfx as xfcGraphics
>loGfx = .Graphics.FromImage(loBmp)
>
>* "Clears" the background of the image to Red
>loGfx.Clear(.Color.Red)
>
>* Fills a Blue ellipse
>loGfx.FillEllipse(.Brushes.Blue, 20,20,110,110)
>
>* Draw a string to the image
>loGfx.DrawString("GdiPlusX is cool !", ;
>	.Font.New("Verdana", 12, .FontStyle.BoldItalic), ;
>	.SolidBrush.New(.Color.FromRGB(255,255,255)), ;
>	0, 0)
>
>* Prints the image
>loBmp.ToPrinter()
>
>* Saves the image to Disk
>loBmp.Save("c:\GdiPlusXTest.png", .Imaging.ImageFormat.Png)
>
>* Show the image in IE
>RUN /N Explorer.exe c:\GdiPlusXTest.png
>
>ENDWITH
>
>
>
>Play with the toprinter method, send some different parameters, and tell me how it goes for you.
>
>Hope this helps

Will play today with this second 'on the fly' example
Tried with Canvas and got stuck with multiple printjobs
in printer que (see previous reply)

Perhaps I will hit the same rock here with separate bitmaps, unless
there is some way of connecting aray of page bitmaps into single printing task. You also mentioned drawing into memory stream...
How this works / what are printing possibilities in this case ?
I am still in dark here / Again your input is higly appreciated

TIA
Sergio
*****************
Srdjan Djordjevic
Limassol, Cyprus

Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com
Previous
Reply
Map
View

Click here to load this message in the networking platform