How to embed an image in windows target? - haxe

I tried to add embed = true in project xml like this:
<assets embed="true" path="Assets" rename="assets" include="*" exclude="openfl.svg" />
But if I try to delete an image from assets folder, then run the exe file, the image will not be displayed, thus, it still loaded form assets folder.
Can some one help?

Thanks every body, I found the answer of Joshua here Embeding and reading image assets when deploying to Windows
But who to know where to read about the answer in the openFL documentation?

Related

Exception when trying to use icons from Asset Catalog in iOS project with Xamarin TabbedPage

I create a Xamarin Forms project in VS 2017 and started by adding a TabbedPage with three tabs. I then added the icons to the Android (in Resources/drawable) and iOS (Asset Catalogs/Icons) projects.
When I start the project on Android it works fine, but on iOS I get an exception that the UIImage cannot be loaded because initWithCOntentsOfFile returned nil. Which is actually correct, because that's not the correct method to use to access Assets. But it's the TabbedPage calling the method, so I cannot do anything about it.
The TabbetPage looks pretty basic.
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:GreenThumb"
x:Class="GreenThumb.MainPage">
<NavigationPage Title="Today" Icon="current.png">
<x:Arguments>
<local:Current />
</x:Arguments>
</NavigationPage>
<NavigationPage Title="Overview" Icon="overview.png">
<x:Arguments>
<local:Overview />
</x:Arguments>
</NavigationPage>
<NavigationPage Title="Settings" Icon="settings.png">
<x:Arguments>
<local:Settings />
</x:Arguments>
</NavigationPage>
</TabbedPage>
And the Asset Catalog looks like this:
This problem seems to be pretty old, but I haven't found any solutions aside some very dirty hacks.
Is there a clean solution out there? Or do I just have to add all my images in the Resources folder instead of Asset Catalogs?
I struggled in the past on this issue. It seems that icons for tabbed pages are not working in iOS if placed in the .xcassets.
I moved those .png files inside the Resources folder and that made the magic.
I suppose it's a kind of bug on Xamarin.
The same error was occurring to me, and I was putting the images on the .xcassets on iOS.
When I placed the images on the Resources folder, they appeared normally on my TabbedPage.
In the official Xamarin documentation about images, they say to put the images in the Resources folder.
iOS - Place images in the Resources folder with Build Action:
BundleResource. Retina versions of the image should also be supplied -
two and three times the resolution with a #2x or #3x suffixes on the
filename before the file extension (eg. myimage#2x.png).
I place all my images in the .xcassets folder, they apparently work well, but it seems not to work on every case.

phpThumbOf or pThumb for PDF thumbnails in Modx

I'm using phpThumbOf on my site to generate resized images on my modx site. Now I tried to do a download area where I want to show some thumbnails of PDFs, but its not generating them. When I try to use pThumb, it returns the sourcefile path.
I already confirmed, that ImageMagick and php-imagick are installed and enabled.
Also my local development environment should allow to use exec so I can't see why this isn't working.
Did someone got this to work already?
Is Ghostscript running in your setup? It's needed to generate thumbnails of PDFs.
Source:
http://phpthumb.sourceforge.net/demo/docs/phpthumb.faq.txt
Quote:
Q: Can I make thumbnails from a PDF?
A: Yes, as long as you have both ImageMagick and GhostScript
installed. The AFPL version of GhostScript seems to work
better than the GNU version (at least for me it does).
http://www.imagemagick.org
http://www.cs.wisc.edu/~ghost/
You may want to use the "sfn" (Source Frame Number)
parameter of phpThumb to specify which page to thumbnail.
Use pThumb. It's the fork of phpThumbOf.
You say that you're already getting the image path (including the image?). You could put that into something like this:
<a href="[[+image:pthumb=`w=800&h=400&zc=0`]]" rel="lightbox" title="Click for enlagement" >
<img src="[[+image:pthumb=`w=150&h=150&zc=0`]]" />
</a>
Or whatever options you might want. It is always good practice to output the image TV's as text, so you have full control over the actual code.

In XCode Swift project - Material Icons not showing in app

Screen capture of Material styled screen
I need help configuring Material with my Swift project.
As you can see I am able import Material into my project, however the buttons (except for the switchControl) are not appearing. The assets can be seen in the project's Media Library.
I don't know how to test my integration. I'm looking at the MaterialIcon.swift file because I don't think that the path to resources is correct.
I've compared my build to the examples provided by CM and I need help.
Thanks.
If you are using CocoaPods to setup your project, which I think you are based on your issue. You have two options:
Clean the build folder and delete the UserDerived directory, as well, ensure you are using 1.0* of CocoaPods.
Copy the Assets catalog into your application.
All the best :)
Make sure that you are giving the elements a size also.
Let Button = FabButton()
Button.setButtonTitle(title: "Button", forState: .Noarmal)
view.addSubview(Button)
View.Layout(Button).top(0).left(0).width(80).height(80)

KML trying to reference I gif file that is inside of a jar

I have a GroundOverlay with an gif file for the image.
When I'm in the Eclipse debuger it will load the image fine.
But when we build our project so that it all gets embedded into a jar file Google Earh does not know how to find that gif anymore. Does the gif file need to be outside of the jar or is there a way to reference a file that is inside of the jar?
Thank you very much!!!!!!!!!!!!!!!!
You didn't provide a lot of information about how you reference the file in the KMZ. You may want to check this article for more information about how to reference files within a KMZ:
https://developers.google.com/kml/documentation/kmzarchives

I Need Help Modifying CKEditor's Default Image Property Paths

I am using CKEditor with Drupal 6.19. I have tried my installation with both CKFinder and IMCE. When an image is inserted from the image browser into the Image Properties window, CKEditor gets a url similar to:
/sites/example.com/files/images/my_image.jpg
I want CKEditor to simply have:
/files/images/my_image.jpg
file structure of my site is this:
/sites/all/modules/ckeditor/ckeditor
/sites/all/modules/ckeditor/ckfinder
/sites/all/modules/imce
/sites/example.com/files/images/my_mages.jpg
Is this url passed from the file browser, or a default in CKEditor?
If it is CKEditor, where do I find the code to change this, or is it even possible?
The URL suggested /sites/example.com/files/images/my_image.jpg is the correct path. Thats because all files are uploaded to the /sites/example.com/files/ folder. The behavior is correct and should not be modified. (Unless I've not understood your problem correctly or there is a very good reason why you want to store your images under DRUPAL_ROOT/files/images)

Resources