I have a problem with scaling of images.
How i can calculate the rows and columns from the bitmap size (pixel)
I want always print the bitmap in the original size but the image should
aligned right.
dcprint bitmap
Re: dcprint bitmap
I will look into this today and try to give you a solution.
The eXpress train is coming - and it has more cars.
Re: dcprint bitmap
I made changes to DCPRINT.CH and _DCPRC.PRG.
1. Copy DCPRINT.CH to your \exp20\include folder.
2. Copy _DCPRC.PRG to your \exp20\source\dclipx folder.
3. Run BUILD20.BAT or BUILD19_SL1.BAT to Rebuild DCLIPX.DLL.
4. Copy donnay-logo.jpg to your \exp20\bitmaps folder.
5. Copy test.prg and test.xpj to your \exp20\samples\printer folder.
6. Run PBUILD test to build TEST.EXE.
7. Run TEST.EXE. Output should be a TEXT.XPS file.
1. Copy DCPRINT.CH to your \exp20\include folder.
2. Copy _DCPRC.PRG to your \exp20\source\dclipx folder.
3. Run BUILD20.BAT or BUILD19_SL1.BAT to Rebuild DCLIPX.DLL.
4. Copy donnay-logo.jpg to your \exp20\bitmaps folder.
5. Copy test.prg and test.xpj to your \exp20\samples\printer folder.
6. Run PBUILD test to build TEST.EXE.
7. Run TEST.EXE. Output should be a TEXT.XPS file.
Code: Select all
#INCLUDE "dcdialog.CH"
#INCLUDE "dcprint.CH"
FUNCTION Main()
LOCAL oPrinter
DCPRINT ON GRID ;
XPSWRITER TOFILE OUTFILE (DC_Path(AppName(.t.))+"\test.xps")
@ 5,0 DCPRINT SAY '5,30/top-left'
@ 5,30 DCPRINT BITMAP '..\..\bitmaps\donnay-logo.jpg' ALIGN DCPRINT_ALIGN_LEFT
@ 17,0 DCPRINT SAY '17,30/top-right'
@ 17,30 DCPRINT BITMAP '..\..\bitmaps\donnay-logo.jpg' ALIGN DCPRINT_ALIGN_RIGHT
@ 40,0 DCPRINT SAY '40,40/top-left'
@ 40,40 DCPRINT BITMAP '..\..\bitmaps\donnay-logo.jpg' ALIGN DCPRINT_ALIGN_TOP
@ 41,0 DCPRINT SAY '40,60/bottom-left'
@ 40,60 DCPRINT BITMAP '..\..\bitmaps\donnay-logo.jpg' ALIGN DCPRINT_ALIGN_BITMAPBOTTOM
DCPRINT OFF
RETURN nil
* ----------
PROC appsys ; RETURN
- Attachments
-
- koverhage.zip
- (54.61 KiB) Downloaded 736 times
The eXpress train is coming - and it has more cars.
Re: dcprint bitmap
Roger,
first let me say thank you. With this i can continue to work on my problem.
I thought of this (as dcprint say work):
@ NIL, NIL, 5.8, 100 DCPRINT BITMAP "logo.jpg" ALIGN DCPRINT_ALIGN_RIGHT PRINTER oPrinter
Here my problem:
On the page the customer has a area (0,68,5.8,100) to print a logo.
The Bitmap is scaled to this area. Depending on the size of the bitmap, the result is
sometimes terrible. Some customer ask me what size must the bitmap.
So my idea was: Print the bitmap from right to left, no matter what the size is.
As i write ist, i think i must
@ 0, NIL, NIL, 100 DCPRINT BITMAP "logo.jpg" ALIGN DCPRINT_ALIGN_RIGHT PRINTER oPrinter
A other way is calculate the needing area depending on the bitmap size.
But oPrinter:nResolution give me an error (valtype is NIL)
first let me say thank you. With this i can continue to work on my problem.
I thought of this (as dcprint say work):
@ NIL, NIL, 5.8, 100 DCPRINT BITMAP "logo.jpg" ALIGN DCPRINT_ALIGN_RIGHT PRINTER oPrinter
Here my problem:
Code: Select all
DCPRINT OPTIONS TO aOptions;
NAME drname;
SIZE drrows, drcols; // drrows = 76, drcols=103
MARGIN aMargins ;
COPIES 1 ;
CANCELENABLE ;
FONT drschrift ;
PAPERBIN drschacht ;
FORMSIZE drformsize ;
DUPLEXMODE drduplex ;
ORIENTATION drquer;
TITLE "Bitmap Sample"
DCPRINT on to oPrinter OPTIONS aOptions PREVIEW HIDE buttons aButtons
The Bitmap is scaled to this area. Depending on the size of the bitmap, the result is
sometimes terrible. Some customer ask me what size must the bitmap.
So my idea was: Print the bitmap from right to left, no matter what the size is.
As i write ist, i think i must
@ 0, NIL, NIL, 100 DCPRINT BITMAP "logo.jpg" ALIGN DCPRINT_ALIGN_RIGHT PRINTER oPrinter
A other way is calculate the needing area depending on the bitmap size.
But oPrinter:nResolution give me an error (valtype is NIL)
Klaus