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
actionscript-3
sql-server-2014
qemu
phantomjs
mifare
sms
sugarcrm
checkpoint
google-api-oauth
ios-universal-links
minimax
gcloud
velocity
template10
bug-reporting
fibonacci
windowserror
rancher
formtastic
eclipse-jdt
wunderground
ansible-inventory
client-server
word-wrap
lfe
server-side-swift
delphi-xe
gradlew
remap
monaca
jcs
appcmd
htop
sp
wicketstuff
blitz3d
addressbook
copy-constructor
timefield
blackberry-webworks
distcc
strtol
symantec
class-design
init
syslog4j
change-password
nimbus
system-integration
jmh
trendline
taverna
redquerybuilder
clearquest
vectordrawable
tinymce-plugins
maven-archetype
touch-typing
launcher
frisby.js
illegalargumentexception
diffmerge
gnip
selenium-grid2
smartxls
lettuce
slimscroll
xml-validation
google-oauth-java-client
wpa
google-checkout
cocotron
freeimage
scsf
cherokee
session-hijacking
backlight
auto-compile
http-response-codes
iphone-maps
webdb
numerical-computing

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