• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

draw rectangle

 
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Hey, check out my mega multi devastator cannon. It's wicked. It makes this tiny ad look weak:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic