Results 1 to 2 of 2

Thread: Help on Help Workshop

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Talking

    Hola! I am currently using the Help WOrkshop to build a help file for a VB project. I need to be able to insert icons into the text (*.ico files) but the only command I can find to insert pictures into the help file is the command {bmC mypicture.bmp} but this only recognizes bitmaps and will not display an icon.

    How can I 1) insert an icon or 2) change the icon to proper *.bmp format?

    thanks

    Andrew

  2. #2
    Guest
    This will convert an Icon to a Bitmap. Add 2 PictureBoxes and a CommandButton. Load your Icon into Picture1.
    Code:
    Private Declare Function SetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long
    Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
    
    Private Sub Command1_Click()
    
        Picture2.AutoRedraw = True
        Picture1.ScaleMode = vbPixels
        Picture2.ScaleMode = vbPixels
        
        For x = 1 To Picture1.Width
            For y = 1 To Picture1.Height
                cr = GetPixel(Picture1.hdc, x, y)
                Call SetPixel(Picture2.hdc, x, y, cr)
            Next y
        Next x
        
        Picture2.Picture = Picture2.Image
        SavePicture Picture2.Picture, "C:\Windows\Desktop\NewIcon.bmp"
    
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width