By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,813 Members | 1,253 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,813 IT Pros & Developers. It's quick & easy.

THIS IS HTML - Problem displaying text in a picturebox

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.