1. RE: Manipulating a Bitmap

euphoric wrote:
> Would it be possible to put text to a bitmap image, then print it? If 
> so, how would it be done?

I haven't used it ... but the "GD Library" in recent user 
contributions seems to do what you require.

Regards,

Ray Smith
http://rays-web.com

new topic     » topic index » view message » categorize

2. RE: Manipulating a Bitmap

> -----Original Message-----
> From: C. K. Lester [mailto:euphoric at cklester.com]
> Subject: Manipulating a Bitmap
> 
> 
> 
> Would it be possible to put text to a bitmap image, then print it? If 
> so, how would it be done?
> 
> 
> --pseudo-code of what I expect will be the case:
> bmpID = open_bmp( "my_image.bmp" )
> pos = { 15, 23 }
> writeToBMP( bmpID, pos, "Hello world!" )
> printBMP( bmpID )
> -- ;)
> 

Its done by merging images.

(Assuming win32lib is in use).

Define a pixmap with the same dimensions of the .BMP image.
Copy the .BMP image to the pixmap (bitBlt).
Use wPuts() to position the cursor and put the text into the pixmap.
Get the DC of the printer control  (pDC = getDC(Printer) )
Start a new document on the printer.
Start a new page.
Now copy the pixmap to the pDC using bitblit technique.
End the page.
End the document.

and out it should come.

If I have time today, I'll knock up some sample code.
-- 
Derek

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu