dcsimg
Results 1 to 3 of 3

Thread: VB6 -- Edit Image

  1. #1

    Thread Starter
    Lively Member wiz....'s Avatar
    Join Date
    Nov 2008
    Location
    Asia, Earth, Solar System, Milky Way Galaxy, Near Andromeda Galaxy, Universe
    Posts
    78

    Exclamation VB6 -- Edit Image

    Hello,

    I wanted help on a program that would edit an image. What i actually want is to add a strip containing some text to the image.

    This means that I have to increase the height of the image and add my default banner.

    How can this be done ? Is there any available submission or any other post that might help me to get started ??

    Thanks for ur Help in advance.
    Wiz
    PAIN n SUFFERING-Pain is Inevitable,,suffering is optional...........
    WORK EXPECTATION--U can do anything in this world if u don't look for credit.........

  2. #2
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,646

    Re: VB6 -- Edit Image

    Check PSC... : planetsourcecode.com ...

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  3. #3
    Fanatic Member
    Join Date
    Mar 2009
    Posts
    804

    Re: VB6 -- Edit Image

    Here's some code you can study:
    Code:
    Private Sub Form_Load()
     Dim SP As StdPicture
     Dim Cap As String 'caption
     Dim TH As Long, TW As Long 'text width/height
     Dim CapTop As Boolean
     CapTop = True
     Cap = "Default Caption"
     Set SP = LoadPicture("C:\MyDocs\Misc\kws.bmp")
     With Picture1
      .ScaleMode = vbTwips
      .AutoRedraw = True
      TW = .TextWidth(Cap)
      TH = .TextHeight("|")
      .Width = Picture1.ScaleX(SP.Width, vbHimetric, vbTwips)
      .Height = Picture1.ScaleY(SP.Height, vbHimetric, vbTwips) + TH
    
      If CapTop Then
       .PaintPicture SP, 0, TH
       'optional
       Picture1.Line (0, 0)-(.Width, TH), vbCyan, BF
       .CurrentX = (.Width - TW) \ 2 'center the text
       .CurrentY = 0
      Else
       .PaintPicture SP, 0, 0
       Picture1.Line (0, .Height - TH)-(.Width, .Height), vbCyan, BF
       .CurrentX = (.Width - TW) \ 2
       .CurrentY = .Height - TH
      End If
      Picture1.Print Cap
     End With
    End Sub

Tags for this Thread

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width