Re: Update a graphic and save it
- From: "Mike D Sutton" <EDais@xxxxxxxx>
- Date: Fri, 19 May 2006 09:37:02 +0100
After posting the question, I had found some information including the
link you provided. In process of reading all the info now. I had
discovered that saving the image as opposed to the picture would keep the
text I had written, but since the image won't fit on the screen, saving it
also causes it to get 'truncated' to that portion that was visible in the
picturebox at the time it was saved. Thought that I might be able to get
away with loading the bitmap to an image control and then calling
textout(image1.picture.handle, ....., but that did not work either.
The .Handle property of a StdPicture object (assuming its type is set to vbPicTypeBitmap) is a hBitmap, where as
TextOut() requires a hDC. As such if you're happy using the TextOut() call directly and managing your own API font
objects, then simply create a new DC and select the Bitmap handle into it:
'***
Dim hDC As Long
Dim hOldBitmap As Long
hDC = CreateCompatibleDC(0)
hOldBitmap = SelectObject(hDC, Image1.Picture.Handle)
TextOut(hDC, ... )
Call SelectObject(hDC, hOldBitmap)
Call DeleteDC(hDC)
'***
You may also want to take a look at my APIDraw library, which encapsulates all the font creation stuff for you.
Hope this helps,
Mike
- Microsoft Visual Basic MVP -
E-Mail: EDais@xxxxxxxx
WWW: Http://EDais.mvps.org/
.
- References:
- Re: Update a graphic and save it
- From: Mike D Sutton
- Re: Update a graphic and save it
- From: Terry
- Re: Update a graphic and save it
- Prev by Date: Re: Update a graphic and save it
- Next by Date: Re: Trying to flood-fill an irregular shape
- Previous by thread: Re: Update a graphic and save it
- Next by thread: Re: Update a graphic and save it
- Index(es):
Relevant Pages
|