forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Printing graphics regions

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    forums.silverfrost.com Forum Index -> KBase
View previous topic :: View next topic  
Author Message
silverfrost
Site Admin


Joined: 29 Nov 2006
Posts: 172
Location: Manchester

PostPosted: Sun Sep 05, 2004 6:38 pm    Post subject: Printing graphics regions Reply with quote

Summary
Printing a ClearWin graphics region using BitBlt or StretchBlt results in garbled output or no output at all

Solution
Graphics regions are stored as device dependent bitmaps. To print a graphics region you must use a device independent bitmap (DIB) to overcome any device incompatibilities. The get_screen_dib@ function will convert a graphics region to a DIB and the dib_print@ function will copy it to the printer's graphics region.

The following is an example of printing a graphics region:

Code:
integer source_graphics_region_handle
integer source_width, source_height
integer printer_graphics_region_handle
integer hdib
integer dest_x, dest_y, dest_width, dest_height
source_graphics_region_handle = 1
printer_graphics_region_handle = 2
source_width = 600
source_height = 600
call open_printer@(printer_graphics_region_handle)
call create_graphics_region@(source_graphics_region_handle, source_width, source_height)
!
! add code to paint the source graphics region here using functions such as set_device_pixel@
!
call select_graphics_object@(source_graphics_region_handle)
call get_screen_dib@(hdib, source_x, source_y, source_width, source_height)
call select_graphics_object@(printer_graphics_region_handle)
call dib_print@(hdib, dest_x, dest_y, dest_width, dest_height)
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    forums.silverfrost.com Forum Index -> KBase All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group