im4java


Im4Java - How to make transparent PNG based watermark in corner sized proportionally


I'm trying to create transparent sized proportionally watermark. I've written something like that for beginning. How to make watermark resized proportionally and position it with margins?
IMOperation op = new IMOperation();
op.dissolve(30);
op.gravity("SouthWest");
op.addImage(watermarks.get("watermark"));
op.addImage(sourceFilePath);
op.addImage(destFilePath);
CompositeCmd composite = new CompositeCmd();
composite.run(op);
After that I want to resize whole picture. It can be done with one command?
After two hours of playing I've got it:
op.addImage(sourceFilePath);
op.thumbnail(f.getWidth(), f.getHeight());
op.gravity("SouthEast");
op.draw("image Over 50,50 300,300 '"+watermarks.get(site.getPrefix())+"'");
op.addImage(destFilePath);
cmd.run(op);
Where 50,50 it's postiion of watermark, and 300,300 is size of watermark. Ufff

Related Links

Im4Java - How to make transparent PNG based watermark in corner sized proportionally
im4java compare command giving Command exception

Categories

HOME
oop
gcc
alasql
cxf
blob
magento-1.9.2.1
where
okhttp3
xss
country-codes
yacc
theory
hdf5
oxid
watson-dialog
samba
project-reactor
civicrm
printf
xforms
glibc
typedef
lotusscript
beaker-notebook
prepros
oracle-golden-gate
apm
andengine
availability
client-server
matrix-multiplication
queryover
usernotifications
keychain
glide-image-library
pexpect
risc
emacs24
fckeditor
totalview
petapoco
node.js-client
spring-social-twitter
alfred
particle-system
sprockets
weblogic-maven-plugin
django-celery
boost-bind
user-profile
custom-build-step
dynamics-nav-2013
matlab-engine
gulp-cdnizer
grails-3.0.9
copy-on-write
bungeecord
dockerpy
chunks
system.io.packaging
novell
diffmerge
react-os
growl
livescript
android-relativelayout
webshim
node-mongodb-native
ironworker
listpicker
kademlia
google-checkout
pageload
report-viewer2010
custom-cursor
event-propagation
filedialog
capitalization
parallel-python
method-call
quazip
norton
excellibrary
conditional-operator
viewdata
arraycollection
jquery-attributes
dongle
user-preferences
bootstrap-protocol

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App