Results 1 to 8 of 8

Thread: Paint with program... possible?

  1. #1
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default Paint with program... possible?

    Hi,

    I have blue picture and want to write a word on it... It is possible to do that with php or javaScript?

    Picture is image.jpg
    variable with word value: $word

    Thanks for your time

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Using PHP's gd library, you can add a string of text to an image, but this requires using an existing font or adding a font to your server and using that.
    I don't know what you mean about "painting"-- if you are ok with "normal" text, that's fine. If you want it to actually look like a drawing, then that means you need to find a font that looks good.
    If it needs to be animated, you could TRY Javascript, but there aren't many options. Flash is probably what you need to use.


    Here is a very interesting script:
    http://www.vicsjavascripts.org.uk/Sk.../SketchPad.htm

    The only problem is that you have to draw it and then save it. It cannot be generated automatically (from "$text").
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default

    All I want to do is:

    to place symbols in the chosen position on the white background...

    if it is confusing I can try to explain in other way?

  4. #4
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default

    As example I have:

    20x
    13
    ---
    and picture ubtitled2.jpg

    Can script add them together like in my uploaded intitled.jpg??

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    PHP's GD image library functions can do a lot of things, including that, in several ways. They can write a string of text to an image (and you can do this twice for the two values) or they can combine two images.
    However, the functions are very hard to work with and will often be very slow to process.
    It's possible, yes. It's best to pre-process everything, if you don't need it to change a lot.
    For example, when using it to save thumbnails of images, it's best to run all of the images through once, save the thumbnails then not process each time every user loads the page. If the values change each page load, then there's no way around that-- but it will be slow and might cause processing load problems on the server.

    The GD library is difficult, so if you need help writing a specific script, I'd suggest looking for paid help. If you get most of the script done someone may be able to help fix a few things, but working with it is never fun and usually very time consuming. Just a warning.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default

    thanks, I think i will stop searching for that thing...

    Maybe you have some ideas how to upload multiple files with comment, then? Because user can add many images/files or just one and that is difficult for me to create. How will yhe program know how many uploads user inserts?

  7. #7
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    That's a complex question. The easiest way is to do one image (and comment) per upload. Just repeat as many times as they would like.
    You could try to dynamically generate fields with Javascript then parse them all with PHP, but that gets very messy.
    I don't know of an existing script that does this, because it's so system-integrated-- it would be hard to make a "plug and play" script of any kind that would work.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  8. #8
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default

    OK... Thanks.

Bookmarks

Posting Permissions

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