I found, that printing graphics made from GDI+ are ugly when using transparent modes. GDI+ has a own EMF-format. Maybe we should use it for this!?
I found, that printing graphics made from GDI+ are ugly when using transparent modes. GDI+ has a own EMF-format. Maybe we should use it for this!?
I found, that printing graphics made from GDI+ are ugly when using transparent modes. GDI+ has a own EMF-format. Maybe we should use it for this!?
Thanks. I will do some tests on next days before!
It is not a way to print transparent areas to most printers. We must write the graphic into bitmap (or EMF) an then draw the resulting bitmap (or play the EMF)!
Can you please make me understand what is it we are going to achieve that we can not do with present print class using normal GDI? We are now able to print any image without using GDI+
//----------------------------------------------------------------------------//
function png150()
local oWnd, oBar
local cPng := "http://byte-one.com/150.png"
local aPalBmp
DEFINE WINDOW oWnd
DEFINE BUTTONBAR oBar OF oWnd SIZE 80,32
DEFINE BUTTON OF oBar PROMPT "Print" CENTER ACTION PrintPng( cPng )
aPalBmp := oWnd:ReadPalBmpEx( cPng, , .t. )
ACTIVATE WINDOW oWnd ON PAINT oWnd:SayPalBmp( aPalBmp )
PalBmpFree( aPalBmp )
return nil
function PrintPng( cPng )
local oPrn
PRINT oPrn PREVIEW
PAGE
@ 4,2 PRINT TO oPrn IMAGE cPng SIZE 5,5 INCHES
ENDPAGE
ENDPRINT
return nil

But to write to a printer-hDc (oPrint-class) the same transparent circles is not possible!
Thats the point!! This concerns not only transparency but also paths, transforms,....
Could this for the FWH-team a target?
function TestShapes()
local oWnd
local aShapes := {}
local aShape
// Triangle
aShape := { "Line", NARGB( 180, CLR_YELLOW ), 0, 1024, 1024, 0, 0, 1023, 0, 1023, 1023, .T. }
AAdd( aShapes, aShape )
aShape := { "Line", CLR_HRED, 3, 1024, 1024, 0, 0, 1023, 0, 1023, 1023, .T. }
AAdd( aShapes, aShape )
// Circle
aShape := { "Elli", NARGB( 128, CLR_HGREEN ), 0, 1024, 1024, 32, 32, 1023-32, 1023-32 }
AAdd( aShapes, aShape )
aShape := { "Elli", CLR_GREEN, 3, 1024, 1024, 32, 32, 1023-32, 1023-32 }
AAdd( aShapes, aShape )
// Rectangle
aShape := { "Rect", NARGB( 128, CLR_BLACK ), 0, 1024, 1024, 484, 256, 640, 1023 }
AAdd( aShapes, aShape )
aShape := { "Rect", CLR_WHITE, 6, 1024, 1024, 484, 256, 640, 1023 }
AAdd( aShapes, aShape )
DEFINE WINDOW oWnd TITLE "FWH GDI+ SHAPES"
oWnd:nHeight := 500
oWnd:nWidth := 400
@ 400,40 BUTTON "Print" SIZE 100,30 PIXEL OF oWnd ;
ACTION PrintShapes( aShapes )
ACTIVATE WINDOW oWnd CENTERED ;
ON PAINT oWnd:DrawShapes( aShapes, { 40, 40, 340, 340 } )
return nil
function PrintShapes( aShapes )
local oPrn
local hBmp
hBmp := FW_CreateBitmap( { 1024, 1024, aShapes } )
PRINT oPrn PREVIEW
PAGE
// GDI+ draw on oPrn:hDCOut
FW_DrawShapes( oPrn:hDCOut, aShapes, { 50,50,300,300 } )
// Print as GDI Bitmap
@ 4,1 PRINT TO oPrn IMAGE hBmp SIZE 4,4 INCHES
ENDPAGE
ENDPRINT
DeleteObject( hBmp )
return nil
