This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

draw rectangle

 
Mohamed Farouk
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends
I have an image in the in my html i would like to use javascript to draw a box over it to selected the portion to cut in the image. Is there any way to draw a box. I have the code ready for cuting and cleaning the image.
Please can you help me telling how to draw a rectangle say in blue colour transparent box over the image ?. I is for making hte user understanding is crop portion.

Please help

Thanks
Farouk
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Best you can do is create a div(layer) with the border set and position that.

Eric
 
Mohamed Farouk
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply
I need to draw a rectangle using mouse over the image say in blue color?
Is it possible. The user should draw it.
Thanks
Farouk
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64633
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, there is no drawing API for the browser window. All you can do is fake it as Eric described.
 
Mohamed Farouk
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends
Please let me know a code sample of how to create a div tag and create a box.
As I need some work done urgently. Please help
Thanks
Farouk
 
Mohamed Farouk
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Eric
I was looking in your website and your box punch examples. Now the boxes created using DIV tags can they be transparent. I dont need any text inside the box except they have to be transparent. And it should look like a box which is selected for cropping in the image.
Please help with some code

Thanks
Farouk
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic