Paintcode export to subfolder - paintcode

When defining export to image settings for a canvas, is there a way to let PaintCode export to different folders depending on the canvas?
A few of my canvasses are language dependend and need to be exported into subfolders with the language in it (android)....

Currently there is no option for doing what you want.
I believe what you should be doing, instead, is to parameterize the String itself, like so:
This way you expose your String and can set whatever you want at runtime.

You can name each canvas with / to get subfolders. E.g. a canvas named
Resources/Images/Top
will export into [root]Resources/Images/Top.png
You can even put / in the "File Suffix" field to get even further into subfolders.
For example when I export png's into an iOS imageset I name each canvas like this:
Canvas name: Assets.xcassets/TopLeft0.imageset/
File Suffix: Image
File Suffix: Image#2X
File Suffix: Image#3X

Related

How do you export a region in paper.js

I'm currently using the following code to export a region on a layer using paper.js:
var boundsArtboard = new Rectangle({x:10,y:10, width:100, height:100});
var svg = paper.project.exportSVG({asString:true,precision: 5, bounds:boundsArtboard});
When I view the exported SVG in a web browser it appears correctly. However, if I open this SVG file in Illustrator, the SVG file contains all objects that exist on that currently layer. See attached SVG image example. How do I just export the objects in the bounds and not everything on the layer?
Example SVG export
Create a new temp layer
Loop all objects and check if they intersect or contain segments inside boundsArtboard rectangle
If they do, clone path and add it to tempLayer
Export tempLayer
Delete tempLayer

How can I access an SVG included as part of my new Plasmoid in Plasma 5?

I'm trying to learn how to create Plasmoids. Right now, I have a custom SVG file that I would like to include with the Plasmoid. I can't seem to access SVG files that aren't part of my current theme, thus if I installed the plasmoid on a different installation, I would also have to add the SVG to whatever theme the user is using.
Is there a way to include the SVG in the plasmoid package, and have it installed when the plasmoid is installed? Or, otherwise, is there a way to access an SVG file that is located in the plasmoid's directory, rather than the Theme's directory?
You can use the relative path of the icon, so let's say you have a directory structure like this:
plasmoid/contents
plasmoid/contents/metadata.desktop
plasmoid/contents/ui
plasmoid/contents/ui/main.qml
And you want to use the icon in your main.qml, you can add a folder like images or whatever you want to call it and put your image into that folder:
plasmoid/contents/images/your_icon.png
now in your main.qml you can reference that icon by using smth like this:
import QtQuick 2.0
Image{
source: "../images/your_icon.png"
}

How to change the imageSource of image in?

I have an image in LiveCode that I would like to change to another image when a specific button is pressed. So far, I have tried this -
set the imageSource of image "The_Hangman" to "/HangMan/1.png"
However, I am getting an error code of:
execution error at line n/a (Object: can't set this property)
How do I fix this?
ImageSource refers to the image that is embedded in a text field, which is not what you want.
If you're using imported images, it's not intuitive at all, but the property you want to change is the text property:
set the text of image "abc" to the text of image "xyz"
Setting the text property changes the imageData and alphaData of the designated image at the same time.
If you're using referenced images (images outside your stack), set the fileName property of the image you want to change to the file path of the new image.
Here's how to do it using external image files:
Let's say you have your images stored in a folder called "images" that is in the same location on your disk as your stack file.
put "hang1.png,hang2.png,hang3.png" into tImgList
put 1 into tCurrImg
set the fileName of image "The_Hangman" to \
(specialFolderPath("resources") & item tCurrImg of tImgList)
Now by simply changing the value of tCurrImg you can display whichever external image file you want.

Expression Blend's default LayoutRoot

Is there a way to change the default LayoutRoot type in Expression Blend 3? Currently, I'm prototyping in SketchFlow, and I prefer Canvas over the Grid, and it's annoying to change it for every new screen.
Here is answer that will work, but you will need to change the templates:
Back up the contents of the template directory which resides here:
%ProgramFiles%\Microsoft Expression\Blend 3\Templates\
Find the templates being used in:
%ProgramFiles%\Microsoft Expression\Blend 3\Templates\(CSharp|VisualBasic)\
In that directory there will be 4 relevant templates:
SketchFlowCompScreen,
SketchFlowCompScreenSL,
SketchFlowNavScreen,
SketchFlowNavScreenSL
If you edit the xaml files within these, whenever you create a new screen in SketchFlow the screens will use your changes.

How do I display a dynamically resized image in Kohana without saving it?

I have an image path string stored in a database
It goes like: img/uploads/imagename.jpg
I have a controller:
$this->image = new Image($wines->image)
//this is assuming that I have a wines table with the image property
$this->image->resize(60, 250, Image::AUTO)
echo $this->image->render();
//the problem is nothing is rendered
//Is there a better way of doing this? the image path that I am passing at the Image object //instantiation is the result of a query
Don't use "echo"
Move the render to a view
You need not use the echo itself. render() itself echoes the output to the browser. Maybe, you need to use render(true), as per the document.
http://docs.kohanaphp.com/libraries/image#render
EDIT: Also be careful with the paths. If possible, use absolute paths OR preferably paths relative to your document root.

Resources