469,917 Members | 1,473 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,917 developers. It's quick & easy.

THIS IS HTML - Problem displaying text in a picturebox

I draw text in a bitmap and then draw the bitmap on a picturebox and get text that is not all displayed the same.

Note the different text style in the (40, 100) area.

Got any insight into what is happening?

Cal

PS

I create a bitmap thusly:

Dim lDataBitmapGraphics As Graphics = picDisplay.CreateGraphics

mDisplayImage = New Drawing.Bitmap(picDisplay.Width, picDisplay.Height, lDataBitmapGraphics)

lDataBitmapGraphics.Dispose()

Then change the size to (40, 100) by doing the following after changing the picturebox clientsize
Private Sub AdjustBitmap()
If mDisplayImage Is Nothing Then Exit Sub

Dim lTmpBitmapGraphics As Graphics = picDisplay.CreateGraphics

Dim lTmpBitmap = New Drawing.Bitmap(picDisplay.ClientSize.Width, picDisplay.ClientSize.Height, lTmpBitmapGraphics)

lTmpBitmapGraphics.Dispose() 'Did this to preserver the PixelFormat

lTmpBitmapGraphics = Graphics.FromImage(lTmpBitmap) IS THESE FOUR LINES BETTER THAN THE LOWER TWO LINE??

'Dim lTmpBitmap As New Drawing.Bitmap(picDisplay.ClientSize.Width, picDisplay.ClientSize.Height) 'picDisplay.Width, picDisplay.Height)

'Dim lTmpBitmapGraphics As Graphics = Graphics.FromImage(lTmpBitmap)

lTmpBitmapGraphics.DrawImage(mDisplayImage, 0, 0)

mDisplayImage.Dispose()

lTmpBitmapGraphics.Dispose()

mDisplayImage = lTmpBitmap

picDisplay.Invalidate()

End Sub
Then draw the string
Nov 20 '05 #1
3 1376
Revised. Added the next to last line below
" active" <ac****@REMOVEa-znet.com> wrote in message news:eR**************@tk2msftngp13.phx.gbl...
I draw text in a bitmap and then draw the bitmap on a picturebox and get text that is not all displayed the same.

Note the different text style in the (40, 100) area.

Got any insight into what is happening?

Cal

PS

I create a bitmap thusly (picDisplay is a picturebox):

Dim lDataBitmapGraphics As Graphics = picDisplay.CreateGraphics

mDisplayImage = New Drawing.Bitmap(picDisplay.Width, picDisplay.Height, lDataBitmapGraphics)

lDataBitmapGraphics.Dispose()

Then change the size to (40, 100) by doing the following after changing the picturebox clientsize
Private Sub AdjustBitmap()
If mDisplayImage Is Nothing Then Exit Sub

Dim lTmpBitmapGraphics As Graphics = picDisplay.CreateGraphics

Dim lTmpBitmap = New Drawing.Bitmap(picDisplay.ClientSize.Width, picDisplay.ClientSize.Height, lTmpBitmapGraphics)

lTmpBitmapGraphics.Dispose() 'Did this to preserver the PixelFormat

lTmpBitmapGraphics = Graphics.FromImage(lTmpBitmap) IS THESE FOUR LINES BETTER THAN THE LOWER TWO LINE??

'Dim lTmpBitmap As New Drawing.Bitmap(picDisplay.ClientSize.Width, picDisplay.ClientSize.Height) 'picDisplay.Width, picDisplay.Height)

'Dim lTmpBitmapGraphics As Graphics = Graphics.FromImage(lTmpBitmap)

lTmpBitmapGraphics.DrawImage(mDisplayImage, 0, 0)

mDisplayImage.Dispose()

lTmpBitmapGraphics.Dispose()

mDisplayImage = lTmpBitmap

picDisplay.Invalidate()

End Sub
Then I change the Picturebox clientsize and the Bitmap as above to the size required for the string

Then draw the string
Nov 20 '05 #2
Cor
Hi Active,

If I was you I would post it again and than with another subject,
I thought it was a HTML problem displaying an image in a picturebox.

Although I maybe can help you, there are better for this subject I think.
Cor
Nov 20 '05 #3
I know in the past some people did not like to download HTML so I warned
them.
Maybe it's no longer a problem so I'll take your suggestion.

Cal

"Cor" <no*@non.com> wrote in message
news:e$**************@TK2MSFTNGP09.phx.gbl...
Hi Active,

If I was you I would post it again and than with another subject,
I thought it was a HTML problem displaying an image in a picturebox.

Although I maybe can help you, there are better for this subject I think.
Cor

Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by wschlichtman | last post: by
33 posts views Thread by Woody Splawn | last post: by
5 posts views Thread by Just Me | last post: by
3 posts views Thread by Kiran A K | last post: by
11 posts views Thread by Usenet User | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.