PDA

Click to See Complete Forum and Search --> : make a monochrome bitmap from a text box ???


Sep 11th, 2000, 04:22 PM
I have a text box with data on it.

what API call can give me raw data to be able to
make a monochrome bitmap from that text box?

I would build the bitmap myself; I just need the bits.

from a pic box ctrl to another one, bitblt works fine.
what would be the equivalent from text box to pic box ?

thank you

Yaz

gwdash
Sep 11th, 2000, 06:47 PM
use this:

Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long

Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long

Private Sub Command1_Click()
Dim DC As Long
Dim ret As Long
DC = GetWindowDC(Text1.hwnd)
ret = BitBlt(Picture1.hDC, 0, 0, Text1.Width / Screen.TwipsPerPixelX, Text1.Height / Screen.TwipsPerPixelY, DC, 0, 0, vbSrcCopy)
Picture1.Refresh
End Sub