How to draw a image over the uiimageview in ios - iphone

I have an application in which I need to clear an image by moving a finger over the image view.
I can do this by using blendmodeClear option. Now for an another option I have to fill those cleared portions of the image view. Can anyone please guide me how to do.
Thanks.

You can maintain stack using NSMutableArray, and keep the images in them after each edit steps. Pop the image last entered if user press an undo option.
for eg:
[image1] --- > red colored
user edits it and adds green color
[image2] --- > green color mixed image
[image1] --- > red colored
user moves finger and clears a part
[image3] --- > image with part partly cleared
[image2] --- > green color mixed image
[image1] --- > red colored
now when user press undo, u can just pop the last entered image (in step 2)
ie. image 2 . (so we get the stage just before the user cleaerd the part of the image
.
does this help? or ur requirement is different?

Related

How to implement 1:2 binary tree view in flutter

How to implement tree node 1:2 binding view in flutter as showed in below figure. By default there one rounded circle. If user click on the circle it will expanded to 2 nodes as shown in below and clicked circle will be changed to green color and need to show node details on above in dialog.
I tried by using https://pub.dev/packages/flutter_treeview
Please find the below diagram.
I want to implement this type of design.
Thanks in advance..

Chronograf set units for y axe

I created a graph for interface statistic (in my custom dashboard), but it shows units like a numbers how I can change it to something like data rate bits/sec.
Also when I saw graphs in default dashboard view it shows different units and it looks good.
I'm using Chronograf 1.3.0
This feature is now available as of Chronograf version 1.3.8.0.
Modifying the units on your graphs can be done as follows, by version:
Chronograf 1.3.8.x
Click the caret at the top-right of a dashboard cell
Click Edit
Image of 'cell caret > Edit'
Select the Display Options tab in the resulting overlay
Edit Y Axis Controls as desired
Click the Green checkmark at the top-right to save your work
Chronograf 1.3.9.x
Click the Pencil icon at the top-right of a dashboard cell
Image of Pencil icon
Select the Options tab in the resulting overlay
Edit Y Axis Controls as desired
Click the Green checkmark at the top-right to save your work

Which kind of variable is more suitable?

I’m going to build a GUI in MATLAB. This GUI page should do my settings.
I’ve six radio buttons, Camera One to Six. Under these radio buttons I’ve three additional radio buttons, Crop Side, and then under this section I’ve a Crop Percent slider.
What I want is, I need to select camera button five, for example, and then automatically set the latest setting that I’ve done on the radio buttons in Crop Side and Slider.
For example, once I’ve select the Camera Two button and set Crop Side to ‘Left’ and Crop Percent Slider to 12.
The next time I check it, the value of Crop side and Crop percent will be set to the ‘Left’ and 12, respectively.
I don’t know which kind of variables and which syntax model would be more useful for this purpose.
Here are links to my code and figure:
https://www.4shared.com/account/home.jsp?sId=kcxzI7wiO9gxGRtq&changedir=-gDLNzzw
http://cdn.persiangig.com/download/GFJExIPKMO/Works.zip/dl
In your callback function for each button, include piece of code to save the buttons value and then load those values each time you choose a new camera, e.g. if you have click on camera 5 and then click on radiobutton for crop it could look something like this:
function radiobuttonCrop_Callback(hObject,event)
% <Here is the code you have atm>
% Add this code
load('guiSettings.mat') % Loads a .mat file containing your settings
settings.cam5.crop = get(hObject,'Value'); % Updates settings.crop to the current value
save('guiSettings.mat') % Saves the updates
end
When you click on another camera, e.g. camera 3, load the settings for camera 3 as below:
function radiobuttonCamera3_Callback(hObject,handles)
load('guiSettings.mat')
set(handles.radiobuttonCrop,'Value',settings.cam3.Crop)
set(handles.slider,'Value',settings.cam3.Slider)
and so on.
Note: guiSettings.mat is the file name containing the settings. When loading with load('guiSettings.mat') you will get the variable settings contained in the file. settings is a struct containing all cameras and all settings for the cameras.
I hope this helps.

Unhide objects/legends in Dashboard tableau

I have objects on the dashboards - filters and legends, I've click 'x' on some of the objects because I dont want to display them. Now I want to display them - how can I make them appear on the dashboard again? I've tried remove and add the sheet again, but doesn't bring back everything anymore.
gemmo
When editing your dashboard, select the sheet or object that you wish to manipulate. You should see a small black triangle in the top right corner of the sheet. Pressing on that triangle reveals a menu that allows you to control it's settings -- including which filters and legends are displayed.
Once you've turned on displaying a filter or legend, you can move it where you like, edit its title or format, or change it between tiled and floating to adjust its position.
To unhide Legends, Follow steps as under in the image:
Select floating and adjust Legends as per your requirement and you will get desired results.

iOS - Interface Builder: UIButton title disappears when setting image

I have made a project previously where I set a UIButton to have both text and also an image (in interface builder).
I have created another project and I want to achieve the same thing, but when I set the button to have an image, the title disappears (it's not getting hidden behind the image).
I can't seem to figure out why this is so if anyone could shed some light on this subject I'd appreciate it!
Thanks.
Change your button to custom type. put the image on then put the text in.
You will need to put your own background on it, but at that point you will be able to use the edge settings to position both the text and the image.
Every button that I have with image and text is set to custom and ultimately has its own bg image as well.
Oh, another thing I use. Is the cornerRadius. To give the view the rounded effect like the buttons have by default.
saveButton.layer.cornerRadius = roundingNumber.floatValue;
Additionally you should be able to use the borderWidth and borderColor in conjunction with cornerRadius to get a button that looks quite similar to the original button
saveButton.layer.borderRadius = 1.0f;
saveButton.layer.borderColor = [[UIColor blueColor] CGColor];
// These are not the exact values (or maybe they are) but you get the idea.
hope that helps.
Correction
After Spending a little time investigating, it appears that when you put an image in the button. the text is shoved off to the right.
Use the edge settings to bring it back over the image.
With the button selected, Look in "Attributes Inspector" > Button > Edge > (Dropdown "Title")
the equasion I have come up with is
[Edge inset for Title] Left = -(imageWidth * 2)
This should Left align your title with the image that you have put in.
Custom positioning will need to be done to make it look correct.
This can be done entirely in the Interface Builder and you can use RoundedRect button style
Here are some images demonstrating the change.
Here I set the Button type to "Custom" to remove the border and background.
Here I set the Top and Left in the Edge set for "Title" (Title is an option in the drop down)
EDIT
Newest Xcode has moved the size settings to a new location
Just put the image in the background field instead. This way the text will appear in front of the image.
It sounds like you are setting the image for the button but not the background image so reverse that.
I noticed that if the UIButton colour is set to default, adding an image makes it white and thus invisible. Changing the colour manually makes it visible again.