Logo
English Russian German French Spanish Italian
contact usprivacy
   Support Forums
chart
• Adjust flexgrid cell
• Animation
• Centering form text
• Coffee machine
• Creating fileshares
• Creating shortcuts
• Custom buttons
• Directory browser
• Disable mouse events
• File search by ext
• File transfer
• File watcher
• Formatting flexgrid
• Get Content Type
• Get HTML source
• Get modem port
• HTTP proxy
• ipconfig
• Large file split/merge
• MAPI
• MCI Sound Player
• Menu with images
• MP3 normalizer
• Net Send
• Netstat 2000
• No duplicate entries
• Outlook Address Book
• Set font color
• Shapes
• SOAP test
• Text-to-image
• Text file viewer
• Text find/replace
• UPS component
• View NT groups
• Word template
• Writing DNS control
    • Using DNS control
• Writing SMTP control
    • Sending email
    • Mailing list
• Writing WhoIs control
    • Using WhoIs control
• View HTML source
OISV - Organization of Independent Software Vendors - Contributing Member
VB projects - Text-to-image converter

Description: saves typed text into bitmap
Minimum requirements: VB6
Download: source code
Screenshot:
VB projects - Text-to-image converter
Project: EXE
Controls: CommandButton cmdClear (located outside visible area), CommandButton cmdCapture, CommandButton cmdFont, CommandButton cmdColor, CommandButton cmdClear, PictureBox pic (Appearance = 0 'Flat, AutoRedraw = -1 'True, ScaleMode = 3 'Pixel, Visible = 0 'False), Label lbl (Appearance = 0 'Flat, AutoSize = -1 'True, BackColor = &H80000005&, BorderStyle = 1 'Fixed Single, ForeColor = &H80000008&), CommonDialog dlg
Additional references: none
Code:
Option Explicit

Private Const SRCCOPY = &HCC0020
Private Const MERGEPAINT = &HBB0226
Private Const SRCAND = &H8800C6
Private Const DIB_RGB_COLORS = 0
Private Const DIB_PAL_COLORS = 1

Private Declare Function BitBlt Lib "gdi32" _
  (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, _
  ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, _
  ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long

Dim nRet As Long

Private Sub cmdColor_Click() frmColor.Show vbModal Command1.SetFocus End Sub
Private Sub cmdFont_Click() dlg.Flags = cdlCFScreenFonts dlg.FontName = lbl.FontName dlg.ShowFont lbl.FontName = dlg.FontName lbl.FontSize = dlg.FontSize lbl.FontBold = dlg.FontBold lbl.FontItalic = dlg.FontItalic lbl.FontStrikethru = dlg.FontStrikethru lbl.FontUnderline = dlg.FontUnderline Command1.SetFocus End Sub
Private Sub cmdCapture_Click() pic.Visible = True pic.Height = lbl.Height pic.Width = lbl.Width nRet = BitBlt(pic.hDC, 0, 0, lbl.Width - 2, lbl.Height - 2, Me.hDC, lbl.Left + 1, lbl.Top + 1, _ SRCCOPY) pic.Picture = pic.Image SavePicture pic.Image, "text.bmp" pic.Visible = False Command1.SetFocus End Sub
Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = 8 Then Exit Sub lbl.Caption = lbl.Caption & Chr(KeyAscii) End Sub
Private Sub cmdClear_Click() Me.Refresh lbl.Caption = "" End Sub

Copyright © 1996-2013 OstroSoft. All rights reserved. info@ostrosoft.com