Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6927555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:04:13+00:00 2026-05-27T11:04:13+00:00

I am doing project in vb.net which is already done in vb6 I am

  • 0

I am doing project in vb.net which is already done in vb6
I am having text box .I want to apply font (style,color,name,size) to selected text.
I am able to do this ..& want to create bitmap of this textbox text so that i can create matrix of 0,1,2,3 digits if text color is red then 1 digit,green-2,orange-3

Following code is done in vb6 but i am not getting some properties in vb.net like
picture1.point
picture1.print (here picture1 is picture box)
here Led is array of (digits 0 or 1 or 2 or 3 )
converttodis is functiont that converts each letter into array
Code is here

 Private Sub CmdPreview_Click()
On Error Resume Next
Dim i
Picture1.Cls
lRow = 0
Lcol = 0
ReDim Led(Picture1.TextHeight(TxtMsg.Text), Picture1.TextWidth(TxtMsg.Text))

For i = 1 To Len(TxtMsg.Text)
    TxtMsg.SelStart = i - 1
    TxtMsg.SelLength = 1
    Picture1.Font = TxtMsg.SelFontName
    Picture1.FontSize = TxtMsg.SelFontSize
    Picture1.FontBold = TxtMsg.SelBold
    Picture1.FontItalic = TxtMsg.SelItalic

   If Mid(TxtMsg.Text, i, 1) <> vbCr Then
    Picture1.Print Mid(TxtMsg.Text, i, 1)

    ConvertToDis i, TxtMsg.selcolor

 ElseIf Mid(TxtMsg.Text, i, 2) = vbCrLf Then
    i = i + 1
    lRow = lRow + Picture1.TextHeight(Mid(TxtMsg.Text, i - 2, 1))
    Lcol = 0
   Else

   Picture1.Print Mid(TxtMsg.Text, i, 1)
    ConvertToDis i, TxtMsg.selcolor
  End If
Next

End Sub


Public Function ConvertToDis(ByVal i As Long, ByVal col)

Dim CX, CY, f, f1, F2
Dim lsubrow, Lsubcol As Integer
lsubrow = lRow
Lsubcol = Lcol

For CY = 0 To Picture1.TextHeight(Mid(TxtMsg.Text, i, 1))
For CX = 0 To Picture1.TextWidth(Mid(TxtMsg.Text, i, 1))
  If Picture1.Point(CX, CY) < vbWhite - 4300000 Then

  If col = 255 Then
    LedCol(lsubrow, Lsubcol) = 1
  ElseIf col = 65280 Then
    LedCol(lsubrow, Lsubcol) = 2
  ElseIf col = 33023 Then
    LedCol(lsubrow, Lsubcol) = 3
  Else
    LedCol(lsubrow, Lsubcol) = 0
  End If
DoEvents
  Lsubcol = Lsubcol + 1
Next

 lsubrow = lsubrow + 1
 Lsubcol = Lcol
Next
Picture1.Cls
Lcol = Lcol + Picture1.TextWidth(Mid(TxtMsg.Text, i, 1))
End Function

for LONG word output is like this

000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000
000011111000000011111100001111101111000111110000000000
000001110000001111111110000111100111001111111100000000
000001110000001111000110000111100110011110001110000000
000001110000011111000011000111100110111110001000000000
000001110000011010000011000111100110110110000000000000
000001110000011010000011000111110110110111111110000000
000001110000011010000011000110110110110110001111000000
000001110000011010000011000110111110110111111110000000
000001110000011110000011000110011110111100001110000000
000001110000101110000111000110011110011100001110000000
000001110011100111001110000110001110011110001110000000
000011111111110011111100001111001110000111111110000000
000011111111110011111000011111001110000111111111000000
000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000
000111111111111111111111111111111111111111111111110000
000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:04:14+00:00Added an answer on May 27, 2026 at 11:04 am

    From Graphics for Visual Basic 6.0 Users:

    In Visual Basic 2008, the Point method no longer exists. You can use the System.Drawing.Bitmap.GetPixel(System.Int32,System.Int32) method to retrieve a color value from a bitmap. For forms or controls that do not contain a picture, you can query the BackColor property.

    In Visual Basic 2008, the DrawString method is used to display text. The font is determined by a Font object, and the color is determined by a Brush object; both are passed as parameters to the DrawString method. The DrawString method also has X and Y parameters that determine the starting location for the text. There is also an optional Format parameter that takes a StringFormat object, allowing you to display text vertically.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing a project in VB.NET 2005, in which I have to extract the
For a project I am doing I need to manually create a .net project.
I'm doing a project in the field of multilevel marketing on .Net and SQL
I'm coming from a Rails background and doing some work on a ASP.NET project
I am doing a hobby project to scrape the content of an ASP.net website
So, I'm doing a setup project, all written in VB.NET, and I need to
Im doing a project with C# winforms. This project is composed by: alt text
I am working on a vb6 project and want to create a manifest so
I've got a project which requires a fairly complicated process and I want to
I have created a a subclass of Table in my ASP.NET project which creates.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.