pbjorge12 Posted June 29, 2006 Share Posted June 29, 2006 I have this image below and I would like to map a dvd cover to it...[a href=\"http://img165.imageshack.us/my.php?image=layout2alphaa4fj.jpg\" target=\"_blank\"][img src=\"http://img165.imageshack.us/img165/5279/layout2alphaa4fj.th.jpg\" border=\"0\" alt=\"IPB Image\" /][/a]Let me give you the info...The dvd cover is always 1600x1074 and I the spine is always 70 pixels wide...I know the exact x/y coordinates of the "template" - For instance, I would need to map the dvd cover's (0, 0) with the template's (60,75).Do you understand what I want to do? How would I do this in PHP (What functions would I use etc.)? Quote Link to comment https://forums.phpfreaks.com/topic/13181-image-manipulation-help/ Share on other sites More sharing options...
.josh Posted June 29, 2006 Share Posted June 29, 2006 look at the gd library resources in the php manual:[a href=\"http://www.php.net/gd\" target=\"_blank\"]http://www.php.net/gd[/a]and also look into captcha tutorials, as this is basically the same thing, as far as combining things together. Quote Link to comment https://forums.phpfreaks.com/topic/13181-image-manipulation-help/#findComment-50711 Share on other sites More sharing options...
pbjorge12 Posted June 29, 2006 Author Share Posted June 29, 2006 At another forum someone said the same thing...Right now I just don't understand how to map the points (I have read over the GD function's summaries)... Quote Link to comment https://forums.phpfreaks.com/topic/13181-image-manipulation-help/#findComment-50712 Share on other sites More sharing options...
.josh Posted June 29, 2006 Share Posted June 29, 2006 here is an example of the code below: [a href=\"http://www.bookmarkmania.com/crayon/test.php\" target=\"_blank\"]http://www.bookmarkmania.com/crayon/test.php[/a](no garauntees on how long the url will be valid) the background image is the gray border and the inside is blank white. the foreground image is the purple with the smiley face. the purple box with smiley face is transposed on top of the background.[code]<?php//make a var for the background image$image_bg = imagecreatefromjpeg('background.jpg');//make a var for the foreground image$image_fg = imagecreatefromjpeg('smiley.jpg');$x_offset = 13; //how far to the right to transpose foreground onto background$y_offset = 13; //how far down to transpose foreground onto background$source_x = 0; //top position to start copy of image_fg at$source_y = 0; //left position to start copy of image_fg at$source_w = 338; //width of image_fg$source_h = 249; //height of image_fg//copy foreground image onto background imageimagecopy($image_bg, $image_fg, $x_offset, $y_offset, $source_x, $source_y, $source_w, $source_h);//make a header for an image typeheader('Content-type: image/jpeg');// send the image to the browserimagejpeg($image_bg);// destroy the image to free up the memoryimagedestroy($image_bg);?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/13181-image-manipulation-help/#findComment-50724 Share on other sites More sharing options...
pbjorge12 Posted June 29, 2006 Author Share Posted June 29, 2006 Thank you for the example...The problem is I need to "skew" the image (Sorry if wrong term was used). The DVD cover is a 1600x1074 rectangle and I need it to fit on the white part of the template.I can't just place the dvd cover over the background image and call it done. I need to put the dvd cover's (0,0) over the template's (60,75) as well as well as the dvd cover's (0,1074) at the template's (642,60).I have 12 points total that I need to map - That is what I don't know how to do... Quote Link to comment https://forums.phpfreaks.com/topic/13181-image-manipulation-help/#findComment-50929 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.