Results 1 to 9 of 9

Thread: Image And Text, I can't Mix, Why?

  1. #1

    Thread Starter
    Frenzied Member wiz126's Avatar
    Join Date
    Jul 2005
    Location
    Mars,Milky Way... Chit Chat Posts: 5,733
    Posts
    1,080

    Image And Text, I can't Mix, Why?

    Ok the php code works perfectly fine on its on. Once I place it in an HTML page, It not longer works. How do I intergrade the code into my html page to make it work? (Do I need to have another header?)

    When I Use This Code:
    PHP Code:
    <html>
            <head>
                <title>This Is A Test</title>
            </head>
        <body>
    <?php
    $im 
    imagecreate(160160);
    $bg imagecolorallocate($im255255255);
    $black imagecolorallocate($im000);
    imagechar($im200'T'$black);
    imagechar($im21010'H'$black);
    imagechar($im22020'I'$black);
    imagechar($im23030'S'$black);

    imagechar($im24060'I'$black);
    imagechar($im25070'S'$black);

    imagechar($im260100'A'$black);

    imagechar($im270120'T'$black);
    imagechar($im280130'E'$black);
    imagechar($im290140'S'$black);
    imagechar($im2100150'T'$black);
    header('Content-type: image/png');
    imagepng($im);
    ?> 
        </body>
    </html>
    I Get This:

    HTML Code:
    <html>
    		<head>
    			<title>This Is A Test</title>
    		</head>
    	<body>
    ‰PNG
    
       
    IHDR   *   *   ±õn   PLTEÿÿÿ   UÂÓ~   •IDATxœí–»
    € EÁO´³µ° b‰ÍQÁÒÒNñ^ˆBSž ÷<‚1qÜ$]~RÁ'·ÎD©` Ù$•XI=(ÉIãm »“Ä3Ib¥JYx’.©ÄJ
    ’øä`üL²#‰“ˆAX©Rxz’cÊI¼R.M{’
    ùIøg•']qÛQb%>á8ÊŸÿYÑ$xŠëÓñ    IEND®B`‚ 
    	</body>
    </html>
    1) If your post has been adequately answered please click in your post on "Mark Thread Resolved".
    2) If someone has been useful to you please show your respect by rating their posts.
    3) Please use [highlight="VB"] 'your code goes in here [/highlight] tags when posting code.
    4) Before posting your question, make sure you checked this links:
    MICROSOFT MSDN -- VB FORUMS SEARCH

    5)Support Classic VB - A PETITION TO MICROSOFT

    ___________________________________________________________________________________
    THINGS TO KNOW ABOUT VB: || VB Examples/Demos
    What are Classes?
    || -
    Where to place a sub/function?(global) || Webbrowser control

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Image And Text, I can't Mix, Why?

    OK... Have a think: how do you normally put images into HTML?

  3. #3

    Thread Starter
    Frenzied Member wiz126's Avatar
    Join Date
    Jul 2005
    Location
    Mars,Milky Way... Chit Chat Posts: 5,733
    Posts
    1,080

    Re: Image And Text, I can't Mix, Why?

    I know its a bit messed up (lol) but
    Hmm, How do I make the image show up in my page?
    1) If your post has been adequately answered please click in your post on "Mark Thread Resolved".
    2) If someone has been useful to you please show your respect by rating their posts.
    3) Please use [highlight="VB"] 'your code goes in here [/highlight] tags when posting code.
    4) Before posting your question, make sure you checked this links:
    MICROSOFT MSDN -- VB FORUMS SEARCH

    5)Support Classic VB - A PETITION TO MICROSOFT

    ___________________________________________________________________________________
    THINGS TO KNOW ABOUT VB: || VB Examples/Demos
    What are Classes?
    || -
    Where to place a sub/function?(global) || Webbrowser control

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Image And Text, I can't Mix, Why?

    You haven't thought yet. Apply brain. Go back to the question: how do you usually put images into HTML documents?

  5. #5

    Thread Starter
    Frenzied Member wiz126's Avatar
    Join Date
    Jul 2005
    Location
    Mars,Milky Way... Chit Chat Posts: 5,733
    Posts
    1,080

    Re: Image And Text, I can't Mix, Why?

    Quote Originally Posted by penagate
    You haven't thought yet. Apply brain. Go back to the question: how do you usually put images into HTML documents?

    hmm <img src="URL"> ?
    1) If your post has been adequately answered please click in your post on "Mark Thread Resolved".
    2) If someone has been useful to you please show your respect by rating their posts.
    3) Please use [highlight="VB"] 'your code goes in here [/highlight] tags when posting code.
    4) Before posting your question, make sure you checked this links:
    MICROSOFT MSDN -- VB FORUMS SEARCH

    5)Support Classic VB - A PETITION TO MICROSOFT

    ___________________________________________________________________________________
    THINGS TO KNOW ABOUT VB: || VB Examples/Demos
    What are Classes?
    || -
    Where to place a sub/function?(global) || Webbrowser control

  6. #6
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Image And Text, I can't Mix, Why?

    OK! Progress!

    You've already got image output. Now... how could we combine those two concepts?

  7. #7

    Thread Starter
    Frenzied Member wiz126's Avatar
    Join Date
    Jul 2005
    Location
    Mars,Milky Way... Chit Chat Posts: 5,733
    Posts
    1,080

    Re: Image And Text, I can't Mix, Why?

    I see where you are going with it (I thought about it before posting), But It will get me into problem #2.
    You want to place the code in page1.php and have it loaded into page2.html....

    But,
    My Actual Image is being generated using user input (POST Method). How do I show in my HTML page the image (after the userinput). How do I go about doing this kind of thing?
    1) If your post has been adequately answered please click in your post on "Mark Thread Resolved".
    2) If someone has been useful to you please show your respect by rating their posts.
    3) Please use [highlight="VB"] 'your code goes in here [/highlight] tags when posting code.
    4) Before posting your question, make sure you checked this links:
    MICROSOFT MSDN -- VB FORUMS SEARCH

    5)Support Classic VB - A PETITION TO MICROSOFT

    ___________________________________________________________________________________
    THINGS TO KNOW ABOUT VB: || VB Examples/Demos
    What are Classes?
    || -
    Where to place a sub/function?(global) || Webbrowser control

  8. #8
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Image And Text, I can't Mix, Why?

    There are a couple of ways. One is to store the image in a session variable. This relies on cookies, however.

    Another way is to use a data URI, and output it directly into the src attribute. I am not sure how many browsers support these, however. I know Mozilla does, at least; and possibly IE 7, but I doubt that.

  9. #9

    Thread Starter
    Frenzied Member wiz126's Avatar
    Join Date
    Jul 2005
    Location
    Mars,Milky Way... Chit Chat Posts: 5,733
    Posts
    1,080

    Re: Image And Text, I can't Mix, Why?

    I could try using a GET mothod (really long address, but it will work).
    I just thought there is an easer way of doing such a thing.
    1) If your post has been adequately answered please click in your post on "Mark Thread Resolved".
    2) If someone has been useful to you please show your respect by rating their posts.
    3) Please use [highlight="VB"] 'your code goes in here [/highlight] tags when posting code.
    4) Before posting your question, make sure you checked this links:
    MICROSOFT MSDN -- VB FORUMS SEARCH

    5)Support Classic VB - A PETITION TO MICROSOFT

    ___________________________________________________________________________________
    THINGS TO KNOW ABOUT VB: || VB Examples/Demos
    What are Classes?
    || -
    Where to place a sub/function?(global) || Webbrowser control

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