I created an image in TCPDF with $pdf->Image(... and set the border value to = 1.
But how do I change the width of the border?
The SetLineWidth() method will work.
http://www.tcpdf.org/doc/code/classTCPDF.html#a0ef34c0ce76bd8e4671da42b3588d9b6
I tested this by adjusting the border argument in the Image() call at line 38 of example_003.php to enable the border and then adjusted as follows and observed that the border became thicker:
$this->SetLineWidth( 1 );
$this->Image($image_file, 10, 10, 15, '', 'JPG', '', 'T', false, 300, '', false, false, 1, false, false, false);
Related
https://jsfiddle.net/Kondaldurgam/akb4Lj61
I'm trying to add images in chart using Highcharts.I doubt whether highcharts support images .i want to import image in empty content.Any help would be appreciated.Thank you in advance.
Highcharts.chart('container', {
chart: {
type: 'bubble',
plotBorderWidth: 1,
zoomType: 'xy'
},
title: {
text: 'No Date Availavle'
},
});
https://jsfiddle.net/akb4Lj61/3/
Here's an updated jsfiddle, you just have to add
renderer.image('https://www.highcharts.com/samples/graphics/sun.png', 100, 100, 30, 30)
.add();
To your chart, put the url, x position, y position and height, width as parameters.
for some reason I cannot make a font italic in three.js. I use below code for it which works well for setting font size or color, but italic just won't work.
var params = {
material: 0,
extrudeMaterial: 1,
bevelEnabled: false,
bevelThickness: 8,
bevelSize: 4,
font: fonts[0].font,
weight: this.weight,
style: this.style,
height:(this.type==0) ? 0 : gravurDepth,
size: this.size,
curveSegments: 4
};
var textGeo = new THREE.TextGeometry(this.txt, params);
I set this.style via below line and see the values get set in debug mode
this.style = (this.style == "normal") ? "italic" : "normal";
Is there some special font I need to load like I guess for the bold case? There do not seem to be special fonts for Italic in the example/fonts folder..
Thanks!
Tom
I have tried the following code, the task I am trying to do is to first populate the window with an image stack and then every time you click on one, it removes it one by one.
var colors = ['red', 'blue', 'yellow', 'green', 'gray', 'black'];
for (var i in colors) {
var image = Titanium.UI.createImageView({
backgroundColor : colors[i],
top : 50,
left : 30,
width : 200,
height : 200
});
$.win.add(image);
}
image.addEventListener('click', function(e) {
alert(e);
alert(JSON.stringify(e.source));
$.win.remove(image);
});
and then when they click on each image, it gets removed from the window - the next one is then shown.
The event listener works fine for the first image view, but then stops working with the underlying ones.
I know that this can easily be done with a scrollableView, but I would like to try and do this using an image View stack.
Cheers.
You have to put the event listener inside the loop !
var colors = ['red', 'blue', 'yellow', 'green', 'gray', 'black'];
for (var i in colors) {
var image = Titanium.UI.createImageView({
backgroundColor : colors[i],
top : 50,
left : 30,
width : 200,
height : 200
});
//this is what you should do
image.addEventListener('click', function(e) {
alert(e); alert(JSON.stringify(e.source)); $.win.remove(image);
});
$.win.add(image);
}
Try this:
var colors = ['red', 'blue', 'yellow', 'green', 'gray', 'black'];
function imageHandler(_imgObj,_win)
{
_imgObj.addEventListener('click', function(e) {
alert(e);
alert(JSON.stringify(e.source));
_win.remove(image);
});
}
for (var i in colors) {
var image = Titanium.UI.createImageView({
backgroundColor : colors[i],
top : 50,
left : 30,
width : 200,
height : 200
});
imageHandler(image,$.win);
$.win.add(image);
}
What this does is remove the handler separates the handler and gives you more control. Through each iteration in the for-loop, each image has it's own handler defined and this should work.
How would you crop a small portion of a big image (e.g area of an imageview visible in a transparent frame) in appcelerator titanium for both iOS and android? imageAs** functions won't work as they aren't supported below android 3.0 . Here is my code:
var win=Ti.UI.createWindow({backgroundColor: 'white'})
var ImageView = Titanium.UI.createImageView({
width:200, height:200,
});
var cropView = Titanium.UI.createView({
width: 150,
height: 150,
borderColor: 'red',
borderWidth: 1,
zIndex: 1,
});
var button= Ti.UI.createButton({
bottom: 30,
width: 60,
title: 'OK',
zIndex: 1,
})
win.add(cropView)
Ti.Media.openPhotoGallery({
PhotoGalleryOptionsType : Ti.Media.MEDIA_TYPE_PHOTO,
success: function(e){
ImageView.image=e.media;
win.add(ImageView)
}, });
button.addEventListener('click',function(e)
{
// crop the visible area
})
I am using iOS 5 and android 2.2. Thanks for your help.
Add ImageView to cropView (rather than to win), position and size imageView so that the portion you want displayed is displayed (using negative values for left and top), and then call cropView.toImage(). You can use the resulting blob in a new image view, save it to a file, email it as an attachment, whatever you want.
Any portion of the image outside of its parents bounds will be cropped, leaving only the portion you specify.
I have done some small changes and now its all functional. Cheers!! :)
var win = Ti.UI.createWindow({
backgroundColor : 'white'
})
var orignal = Titanium.UI.createImageView({
width : Ti.UI.SIZE,
height : Ti.UI.SIZE,
left:5
});
var ImageView = Titanium.UI.createImageView({
width : 200,
height : 200
});
var cropView = Titanium.UI.createView({
top : 10,
width : 150,
height : 150,
borderColor : 'lime',
borderWidth : 1,
zIndex : 1,
left:150
});
var button = Ti.UI.createButton({
bottom : 30,
width : 60,
title : 'CROP',
zIndex : 1,
});
win.add(button);
Ti.Media.openPhotoGallery({
PhotoGalleryOptionsType : Ti.Media.MEDIA_TYPE_PHOTO,
success : function(e) {
ImageView.image = e.media;
orignal.image=e.media;
cropView.add(ImageView);
win.add(cropView);
win.add(orignal);
},
});
var CropedImageView = Titanium.UI.createImageView({
top : 200,
width : cropView.width,
height : cropView.height,
left:150
});
button.addEventListener('click', function(e) {
cropView.borderColor='transparent';
CropedImageView.image = cropView.toImage();
win.add(CropedImageView);
});
win.open();
I learnt some of this while my stay at Oodles Technologies.
Here's my contribution :
In this example you will see how to crop image in iOS Titanium.
To crop a image first create scroll view, define its maxZoomScale, minZoomScale.
maxZoomScale:-
Maximum Scaling factor of the scrollable region and its content.
minZoomScale:-
Minimum Scaling factor of the scrollable region and its content
maxZoomSale and minZoomScale we can adjust according to required.
then we have to add image view inside scrollview, then we can zoom in and zoom out image, to crop a image just need to click on crop button.
var window = Ti.UI.createWindow({
backgroundColor : 'white'
});
var scrollView = Ti.UI.createScrollView({
height : 260,
width : Ti.UI.FILL,
maxZoomScale : 4.0,
minZoomScale : 1.0,
zoomScale : 1.0,
});
window.add(scrollView);
var imageView = Ti.UI.createImageView({
height : scrollView.height,
width : scrollView.width,
backgroundColor : "transparent",
anchorPoint : {
x : 0.5,
y : 0.5
},
image : 'Default-568h#2x.png',
});
scrollView.add(imageView);
var button = Ti.UI.createButton({
top : 20,
title : 'Crop Button'
});
window.add(button);
button.addEventListener('click', function(e) {
button.hide();
var cropimage = scrollView.toImage();
var cropImageView = Ti.UI.createImageView({
top : 20,
height : 120,
width : 120,
image : cropimage
});
window.add(cropImageView);
});
window.open();
I'm trying to use a tileset in my game. I want to crop the fill image but can't because
I can't fill a shape with a Kinetic.Image() object.
I can't crop a Image() object.
var rect = new Kinetic.Rect({
x: 0,
y: 0,
width: 64,
height: 64,
fill:{
image: imageObj,
crop:{
x: 128,
y: 128,
width: 64,
height: 64
},
},
strokeWidth: 1
});
This doesn't work, and I also can't replace image: imageObj with a Kinetic.Image() object that is precropped. Any ideas?
EDIT: Looks like it might be possible by drawing the Kinetic.Image to the scene, using toDataUrl to load the cropped Kinetic.Image into a image object useable by fill, then continue with the map script. This introduces a ton of performance issues/loading times so I'm going to go ahead and assume what I want to do just isn't feasible. If anyone has any ideas on how to do this properly please let me know.
You can get fill to accept an image, as shown in this example with the Vader/Yoda:
http://www.html5canvastutorials.com/kineticjs/html5-canvas-set-fill-with-kineticjs/
What i'd suggest is loading your images into an array (as he does in the example) then calling the images out as you create the tile.
I changed the code for the first Pentagon to a Rectangle on that example like so:
var colorPentagon = new Kinetic.Rect({
x: 40,
y: 50,
width: 100,
height: 100,
fill: {
image: images.darthVader,
offset: [-220, -70]
},
stroke: "black",
strokeWidth: 4,
draggable: true
});
And it worked, so no reason that can't give you what you want.