Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

How do I get TRANSPARENT pixels?

WSinc
New Contributor I
437 Views
When I open a graphics window, the pixels for a blank window are all BLACK.

I want to print the graphics I generate onto a transparency, so I would like to change those
background pixels to WHITE pixels, so I can copy them onto a transparency.

But maybe there is no easy way to do that. The SET BACKGROUND FILL function does not
make ALL the pixels WHITE, unfortunately.

Ideally, I would like to print the window directly onto a transparency, but I don't see a way to
get transparent pixels.

Is there a way to set ALL the pixels in a newly opened graphics window to WHITE?

Do I need to use Photoshop or some other similar tool?
0 Kudos
1 Reply
Paul_Curtis
Valued Contributor I
437 Views
[bash]RECURSIVE SUBROUTINE fill_rectangle (hdc, color, rect, edge)
	IMPLICIT NONE
	INTEGER(HANDLE), INTENT(IN)		:: hdc
	INTEGER, INTENT(IN)             :: color
	TYPE(T_RECT), INTENT(IN)		:: rect
	INTEGER, INTENT(IN), OPTIONAL	:: edge
	INTEGER(HANDLE)					:: hbrush, hold
	INTEGER                         :: rval 

	!	these statements always go together,
	!	and this routine ensures that a brush
	!	resource is always destroyed after use

	hbrush = CreateSolidBrush (color)
	hold   = SelectObject     (hdc, hbrush)
	rval   = FillRect		  (hdc, rect, hbrush)
	rval   = SelectObject     (hdc, hold)
    rval   = DeleteObject     (hbrush)

	IF (PRESENT(edge)) THEN
		IF (edge == 1) rval = DrawEdge (hdc, rect, EDGE_SUNKEN, BF_RECT)
	END IF

END SUBROUTINE fill_rectangle
[/bash]
0 Kudos
Reply