473,513 Members | 2,519 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1505
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2832
by: Joe Price | last post by:
Hi chaps I've got an XML file, within that file i've embedded html code using the <!]> tag I'm displaying that xml file through a browser using an xsl style sheet. However it is displaying...
1
11551
by: wschlichtman | last post by:
I'm attempting to retrieve a bitmap from an image field in SQL Server 2005 using Visual Studio 2005 C#. I then want to load the bitmap into a picturebox. When I run the following code, I get the...
3
1113
by: _eee_ | last post by:
Does anyone have a pointer to code for: 1 Filtering text from html? (removing html tags, etc) 2 Displaying HTML in a windows form or any other useful utilities for dealing with raw HTML.
33
1550
by: Woody Splawn | last post by:
I have a winform with a tab on it. On tabA I have a field called nbrBalDue. In the Click event of a button on tabA I have the following code Me.nbrBalDue.Value = 66 When I click the button...
5
1899
by: Just Me | last post by:
Given a button name Btn_5 and Index=5 I want to do something like dim zz as string = Btn_??Index??.Text or given an array of buttons, do:
2
1705
by: Al Reid | last post by:
I have a series of bitonal TIFF images that I need to display to the user in a form and the image needs to be displayed to fit the container (PictureBox). I also need to antialias the image for...
3
39183
by: Kiran A K | last post by:
Hi, I have an image url (eg:http://myimages.com/pic1.jpg) Now i want to display the above image in a C# windows form. Which control should i use? i am using VS .NET 2003. Pls provide some...
1
2376
by: VICTOR DIACONO | last post by:
I have the following problem. I am trying to print the contents of a number of Textboxes into Labels on a Picturebox. Then I wish to output the Picturebox to the screen. Ok, it is a simple...
11
9742
by: Usenet User | last post by:
..NET 1.1/2.0 I have a need to display high-resolution scrollable images in a .NET application (Windows Forms). One well known solution is to create a Panel with AutoScroll set to "true" and...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7099
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7525
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5086
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3233
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1594
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.