Results 1 to 7 of 7

Thread: Creating bitmaps on-the-fly

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2001
    Posts
    3

    Creating bitmaps on-the-fly

    Slightly off-topic I guess, but does anyone know of a program that will accept a text string, and create a bitmap of a specified size that just contains that string?

    The reason is that we want to create a bitmap for use as a fill-pattern in reports - this will contain the customer's name word-wrapped and repeated to fill the box.

    Any help would be gratefully appreciated.

    Regards
    Pete

  2. #2
    Hyperactive Member razzaj's Avatar
    Join Date
    Oct 1999
    Location
    jounieh
    Posts
    261
    I am looking for something like this only I need to create BMP or GIF Files With lines and colors ...
    - regards -
    - razzaj -

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2001
    Posts
    3
    I've decided to do this another way - I'm just populating a variable with the replicated string, painting it on the report and sending to the back. (so obvious that I never thought about doing it at first!)

  4. #4
    New Member
    Join Date
    May 2001
    Location
    UK
    Posts
    4
    Ok, create a memory DC and bitmap, select the bitmap into the DC, draw on it using TextOut() then either extract the image bits and write the bitmap manually in binary mode, or draw it to a picture box and use it's SavePicture() method.
    Hope this helps,

    Mike
    -- EDais --

    WWW: Http://Members.xoom.com/EDais/
    Work E-Mail: [email protected]
    Other E-Mail: [email protected]

  5. #5

    Thread Starter
    New Member
    Join Date
    May 2001
    Posts
    3
    EDais

    Thanks - that method didn't even cross my mind! I like the SavePicture idea.

    Pete

  6. #6
    New Member
    Join Date
    May 2001
    Location
    UK
    Posts
    4
    Razzaj, in response to your question then basically do the same thing, but use the MoveToEx() and LineTo() API call's for drawing lines and API pen objects for changing the colours.
    Don't bother with trying to save to a .GIF image, if you do then you'll be breaking the law (the .GIF format it patented, it stops developers using it without paying lots of money for a licence) The .JPG format is and open format though if your looking for something to go on the web, you can use the Intel JPEG library which is available on their page and has native support for VB since the last version. Alternatively if you’re looking for something more like the .GIF format then there's a class module on my page written by Warren Galyen that encapsulates .PNG support.
    Hope this helps,

    Mike
    -- EDais --

    WWW: Http://Members.xoom.com/EDais/
    Work E-Mail: [email protected]
    Other E-Mail: [email protected]

  7. #7
    Megatron
    Guest
    Or you can use the Print method of the PictureBox, then size the PictureBox (with TextWidth, and Height) then use SavePicture to save it.

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