Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GDIPlusX and Printing
Message
From
31/03/2007 08:40:53
 
 
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:
01210714
Views:
27
Ave Cesar :)

This is about closest to what I wanted to do with GDI+
up to now !!!
Image canvas might be exatly what I was looking for.
If you don't mind will send you private message about
couple of thing I wld like to ask you.

I saw your blog and drawing samples - Great stuff!
Keep on rockin'&rollin' :)
Jumping on GdiPlusX as from monday.


>Hi Sergio,
>
>Of course Yes ! You can Print your images.
>
>We included the Method "ToPrinter" to the Image Class
>
>Method:
>ToPrinter(tlFitToPage, tcPrinterName, tnOrientation)

>
>None of these paramaters is obligatory, use them if you need only.
>If no parameter is passed, GdiPlusX will print the image at the default printer, in portrait mode
>
> tlFitToPage - Logical, if TRUE, will resize the image to fit the whole page
> tcPrinterName - Character, the name of the desired printer, the same you get from GETPRINTER()
> tnOrientation - 0 = Portrait 1 = Landscape
>
>
>Some samples:
>
>1 - If you want to print directly from the ImageCanvas, check some samples in this article.
>Direct Draw with the Image Canvas from GdiPlus-X
>http://weblogs.foxite.com/cesarchalom/archive/2007/03/20/3535.aspx
>
>At the end of the code, you'll find:
>
>
* Print the Image
>This.oBmp.ToPrinter()
>
>
>There I used the Bitmap object from the canvas, and sent the image directly to the rinter.
>
>
>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
>
>Cesar Chalom
>http://weblogs.foxite.com/cesarchalom
>
>
>>Downloaded GDIPlusX project and hv few questions.
>>
>>1) If I use GDIPlusX to draw on some canvas (shape or form)
>>with VFP9 is there any way to print those drawings ? (No Bitmap)
>>
>>2) Is it possible to draw directly to EMF file and then
>>to preview/print those pages/drawings ?
>>
>>I was looking at impressive list of methods for drawing but
>>nothing for consecutively printing it.
>>
>>Am I missing something and this is trivial task once drawings are done on the form/shape as canvas, Or - direct preview/print is still not viable for us in any way other then using frx ?
>>
>>I want to create my own drawings (report) using GDI+ and then to print it.
>>Or even better; create drawings into emf file and then preview/print
>>it from there.
>>
>>Do I have to dive all the way into GDI+ or somebody already done
>>such thing ? I have heard that alternative PreviewPrint application already exist; so I assume what I want is teoretically possible.
>>
>>Any Input is greatly appreciated.
>>
>>
>>
>>
>>
>>
>>
>>
*****************
Srdjan Djordjevic
Limassol, Cyprus

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

Click here to load this message in the networking platform