Pulling image path from animation [duplicate] - iphone

This question already has an answer here:
Fetching image From Animating UIImageView
(1 answer)
Closed 9 years ago.
I have a standard image animation for a simple banner. I'm trying to make it clickable so when the user clicks on the banner(a featured article list), it takes them to that article.
To achieve this in our Android version, we have a runnable that allows us to change both the image resource and the reference link at the same time.
I have the animation set up like this:
mBannerImageView.animationImages = newArray;
mBannerImageView.animationDuration = 10;
mBannerImageView.animationRepeatCount = 0;
mBannerImageView.startAnimating;
Is there a way/how can I pull the resource name from the image view at the current time? My thought is to have the IBAction for it to pull the resource and direct you from there(matching the image name to something saved in our coredata). If there isn't a way, what would be the best approach for something of this nature?
Thanks for the help!

If you wish to set up image animation, so I have some html code which through you are easily generate image animation. The steps below show you how to create a image animation.
Create a simple animation and save the images as a series of JPG images.
Build an HTML page with the image displayed somewhere on the page using the tag.
Save the file as logo1.htm. Within the tag, include a tag that looks like this:
With the HTML file still open, change the tag so that it displays the second frame of your animation, and change the tag to open logo3.htm and save the file as logo2.htm.
Repeat this process for all frames of the animation.

Related

How I can clean the pdf view

I have a form that makes a pdf when finished and I'm using flutter_pdfview package to view the pdf. I expect to finish the form and view the pdf, but if I want to modify something I want to see the changes, but I just see the first version of the pdf. I have this theory that if I clean the String of the path that pdfview uses to render the pdf. Maybe I could see some changes, but well I have no idea.
Thanks for your attention!

Manage image deletion in a WYSIWYG editor

When an HTML editor is used and images are added from the local computer, they are uploaded to a server and a link is obtained to put it in the image src attribute. What happens when the img element is removed from the editor? How would the image be deleted from the server? In this case I understand that the image deletion event could be detected and then call a service to delete it. But what happens if the user adds a new image and leaves the page? How would it be deleted in these cases?
In both cases, if the deletion of the images is not managed, it could happen that the server is filled with unused images. How do you usually solve this problem? How is the proper way to solve this?
That's a nice question there. And yeah, for sure the server would fill up with unused images in some point. I'm not an expert on this but I'll try to suggest something so I can implement it too in my WYSIWYG editor haha. I suppose you have a custom modal for the insertion of the image. Upon clicking the button you could save the image link to an array and at SAVE || on leaving the document edit || on popstate event you could make a regex that checks the innerHTML of the editor for the specific SRC. If is not found then you could push an ajax request with the image name so you can deleteit. For sure there are more efficient and complex ways to achieve that. Such as creating text ranges and track elements on keydown - Backspace(8) / Deletekey(46).
An other way is that you could track the images that are in use. When the document is saved regex out the images in the document, push them to a db table and periodically make a check from the back end so you can delete those that are not in use.
I don't know if my suggestions are helpful or not. I just saw an interesting subject so I jumped in. Cheers mate.

Mupdf: how to reset the resolution of pdf view page PROPERLY when the CDialogEx(MFC) OnSize?

my pdf file is rendering in a CDialogEx(it's MFC Class),and what i want is to reset the resolution when the Dialog resized.....
I find a solution via the mupdf offical downloads site:first set the desired resolution with pdfapp_setresolution(...), then call pdfapp_reloadpage(...). This reaches my goal but not perfect, with this method the displaying dialog gets a conspicuous redrawing (first the background color, then recovered back normal)...
anybody have a better optimization? thanks
1st. resize the pdfapp_t object according to the view_window size via API pdfapp_onresize()
2nd. adjust the resolution of pdfapp_t object//#attentison# here the resolution needs some transformation on the basis of yr actual requirement, referencing the API pdfapp_autozoom() in pdfapp.c source file.
3rd. show page via pdfapp_showpage()
thats all :) maybe helpful to sb.
PS:lesson is that referencing the official document or example in details first :)

How can I maintain image class when using mc:edit in a MailChimp template?

I'm trying to create a MailChimp template where an image is editable using mc:edit
Here's the code:
<img class="flexibleImage" mc:edit="top_image">
This seems all good, but once I edit this image using the MailChimp editor, I lose the original class "flexibleImage" and all other class and style info related to that img element.
How can I create a template with an editable image and maintain (or add) that class?
For anyone else with the problme, this answer is based on a response from MailChimp support:
It looks like it isn't possible to keep a custom class attached to an
editable image. What you could do instead though is apply the class
to the image's containing element. So if the image is in a <div>, add
flexibleImage to the div, and then update your CSS rules to point to
.flexibleImage>img.
This happens because the image you want to edit is inside an mc:repeatable block that in turn is inside another mc:repeatable block
Even four years later this is still an issue.
The other route is to put mc:edit on the parent container, and have images managed through there, but you lose the Image uploader box, which is poor user experience.
You can go into Settings when you have uploaded a new image and put the sizes in there. Not ideal, but Mailchimp is to blame here (no such issue on Campaign Monitor templates).

GWT getUrl does not return image

I have an image in my war folder. I am trying to see what the image is, but I cannot get it to work. I am trying by using GWT.getModuleBaseURL()but it does not alert.
if(soundImage.getUrl().equals(GWT.getModuleBaseURL()+"/soundOn.png")){
Window.alert("YEP IT DOES");
soundImage.setUrl("soundOff.png");
setSound("off");
}else{
soundImage.setUrl("soundOn.png");
setSound("on");
}
How can I get the image? Am i overlooking something in my code, or am I doing it wrong?
Changing the URL of an image in order to change the view is understandable if you have an HTML background, but is sort of crazy in GWT-land. This is roughly analogous to changing the URL of a <script> on the fly -- it's technically possible, but strange. This image is a child of some component, necessarily. I would replace this image by operating on the component that contains this image, and not on the image itself by changing its URL. The URL of an image is essentially its descriptor, so it's awkward to change a property like this. If you are using MVP and have created a View, then you might expose a method like void toggleSoundImage(boolean on).
You really should be doing this instead: https://developers.google.com/web-toolkit/doc/latest/DevGuideUiImageBundles. The way you are trying to use images is unidiomatic -- some people might call this "wrong".
I purposefully did not answer your question because if you were doing this correctly, the preconditions that caused this problem wouldn't exist.
Hope that helps.
Notice you you are setting the url (soundOn.jpg) using a relative path, but you are checking using the module absolute path.
The URL should merely be the same as the src attribute on your image.
If you use:
if(soundImage.getUrl().equals("soundOn.png")){
It should work. I recommend using Travis' recommendation of Image resources, also.