make a mp4 videos from pictures asp.net [closed] - asp.net

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I want to make a app in which user uploads pictures from their hard disc and then my app make a slide show of those pictures and after that the user is enables to download this in form of mp4 video . How can i do this ASP.NET ?

I found this Image sequence to video stream?
The accepted answer is detailed and feels really close to what you are asking for.
edit:
I found an example here: http://www.aforgenet.com/framework/docs/html/4ee1742c-44d3-b250-d6aa-90cd2d606611.htm
int width = 320;
int height = 240;
// create instance of video writer
var writer = new VideoFileWriter( );
// create new video file
writer.Open( "test.avi", width, height, 25, VideoCodec.MPEG4 );
// create a bitmap to save into the video file
var image = new Bitmap( width, height, PixelFormat.Format24bppRgb );
// write 1000 video frames
for ( int i = 0; i < 1000; i++ )
{
image.SetPixel( i % width, i % height, Color.Red );
writer.WriteVideoFrame( image );
}
writer.Close( );

Related

Samsung Tizen.Net Wearable, How to control object font size dynamically [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
When using objects which contain text, such as a button or label, how can the text be dynamically sized in order to better keep text of different lengths within the viewable area?
For example if a Label within a Cell of a CircleListView of a CirclePage and the text becomes too long, it will easily fall out of view:
For context to what im looking for, in Android I am able to give an object either an autoSizeMinTextSize and/or autoSizeMaxTextSize tags which will automatically resize the font size based on the text length of the object.
This allows text of unknown lengths to be better kept on the screen.
How can this be done with in a Tizen.Net application, using CircularUI elements like Button or Label or with Xamarin.Forms in general?
After looking into this for a while I was able to learn of a few ways to resize text dynamically.
Take a center aligned Label:
PrimaryText = new Label
{
FontSize = _maxFontSize,
HorizontalTextAlignment = TextAlignment.Center,
};
Adding it to a Layout gives it access to the MeasureInvalidated event:
TextStack = new StackLayout
{
WidthRequest = _maxWidth,
Children = { PrimaryText }
};
Then when the text changes (among other things) the event will trigger where you can measuer the new text, compare it to the width of the stack, and then manipulate the size of font until the text fits within your layout:
TextStack.MeasureInvalidated += (sender, args) =>
{
var primaryMeasure = PrimaryText.Measure(PrimaryText.Width, PrimaryText.Height);
var stackMeasure = TextStack.Measure(TextStack.Width, TextStack.Height);
if (primaryMeasure.Request.Width > stackMeasure.Request.Width)
{
if (PrimaryText.FontSize <= _minFontSize)
PrimaryText.HorizontalTextAlignment = TextAlignment.Start;
else
{
var fontSize = PrimaryText.FontSize - 2;
if (fontSize < _minFontSize)
fontSize = _minFontSize;
PrimaryText.FontSize = fontSize;
}
}
};

Unity - Wait in MainMenu till Scene is completely loaded [duplicate]

This question already has answers here:
Objects in Scene dark after calling LoadScene/LoadLevel
(7 answers)
Closed 5 years ago.
I have a little problem with my main menu in Unity.
If I press the "Play" Button, it starts the game how I want it to.
The problem is, that my scene "Lights" are not completely loaded. (I have a lot of effects in it). So the scene is loaded, but everything is dark, completely without the lights:
I tried it with asynchronous "LoadSceneAsync", like so:
public void LoadByIndex(int sceneIndex) {
StartCoroutine(LoadNewScene(sceneIndex));
}
IEnumerator LoadNewScene(int sceneNumber) {
AsyncOperation async = SceneManager.LoadSceneAsync(sceneNumber);
while (!async.isDone) {
Debug.Log("hello");
yield return 0;
}
}
Ok i got it.
The problem was the Auto-Light-Baking.
Just go to Window > Lighting > Settings > Scene
And then scroll to the bottom and uncheck the "Auto Generate" for "Generate Lighting"

javaFX. How to set auto fill built-in module? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
So, I have main frame start.fxml and opinion.fxml.
start.fxml - have "Button" item, and empty "AncorPane".
When I click on Button, in "StartController.java" execute:
#FXML
private AnchorPane ancorPaneMainFrame;
....
public void StatisticOpinion() {
try {
Node node = (Node) FXMLLoader.load(getClass().getResource("/StatisticsPackage/Opinion/opinion.fxml"));
ancorPaneMainFrame.getChildren().setAll(node);
} catch (IOException ioe) {
// logging ioe
}
}
That script is place opinion.fxml in AncorPane of start.fxml.
So, now I have problem with auto-resize opinion.fxml when I change size of start.fxml by mouse while programm is working.
opinion.fxml is not fill-out of parent AncorPane...
Assuming the AnchorPane is properly resized and node is resizeable you simply have to set the anchors:
Node node = (Node) FXMLLoader.load(getClass().getResource("/StatisticsPackage/Opinion/opinion.fxml"));
// set anchors
AnchorPane.setBottomAnchor(node, 0d);
AnchorPane.setTopAnchor(node, 0d);
AnchorPane.setLeftAnchor(node, 0d);
AnchorPane.setRightAnchor(node, 0d);
ancorPaneMainFrame.getChildren().setAll(node);

Display JavaFX Image without blur/dithering when zooming in

I'm trying to create a image editor tool, where I have X- and Y-axis. Now I want to support the user by seeing each pixel when zooming in so that they can work more exactly. In comparison you should take a look at paint.net where you can see the pixels when zooming in.
I'll give you a code snippet and perhaps you might have a hint for me where I should dig into (API or code examples). I've found nothing like it in the JAVAFX API documentation. I want to use an ImageView instance but not a Canvas.
ScrollPane scrollPane = new ScrollPane ();
BorderPane borderPane = new BorderPane();
Group group = new Group();
DoubleProperty zoomProperty = new SimpleDoubleProperty(1);
Scale scaleTransformation = new Scale();
scaleTransformation.xProperty().bind(zoomProperty);
scaleTransformation.yProperty().bind(zoomProperty);
ImageView viewer = new ImageView(getBackgroundImage());
viewer.setFitWidth(600);
viewer.setPreserveRatio(true);
viewer.setDisable(true);
viewer.setSmooth(false);
group.getChildren().add(viewer);
this.addEventFilter(ScrollEvent.SCROLL, new EventHandler<ScrollEvent>(){
#Override
public void handle(ScrollEvent se) {
if (se.isControlDown() && se.getDeltaY() > 0) {
double value = zoomProperty.get() * 1.1;
zoomProperty.set(value);
se.consume();
} else if (se.isControlDown() && se.getDeltaY() < 0) {
double value = zoomProperty.get() / 1.1;
zoomProperty.set(value);
se.consume();
}
}
});
borderPane.setCenter(group);
scrollPane.setHbarPolicy(ScrollBarPolicy.ALWAYS);
scrollPane.setVbarPolicy(ScrollBarPolicy.ALWAYS);
scrollPane setContent(new Group(borderPane));
Thanks for you help.
EDIT
The related question and it's answers do not solve my problem (JavaFX ImageView without any smoothing). The solution 1-4 do not work. Only the hack does. I guess I could be related the node structure I use. I've adjusted my code.
I have found one solution (referring to the possible duplicate) and using a variant of method 1.
In my image constructor I set the requested size to something large - so for an image that I know is about 1000 pixels wide I request an image 10000 pixels wide:
Image image = new Image(file.toURI().toString(), 10000.0, 10000.0, true, false);
I am not sure if this is giving a true view of the pixels, or if it is smoothing at a very low level...... but it works for my needs.

Slider's background changes while scrolling the page,How Could it be possible [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Please take a look at this website :
http://psnprofiles.com/
How does the slider's background work? I think it's a div but how do you place it behind everything else and as you scroll down you see an effect on the slider's background picture how can I make my slider's background like that,to change while someone is scrolling the page down.
what you want is a jQuery scroll script. In that page, see down the bottom
if ($('#slider'))
{
$(window).scroll(function(e)
{
var scrollTop = $(this).scrollTop();
if (scrollTop <= 520)
{
if (scrollTop < 60)
{
scrollTop = 60;
}
$('#slider').css('-webkit-transform', 'translate3d(0,'+Math.floor((scrollTop-60)/2)+'px, 0)').css('-moz-transform', 'translate3d(0,'+Math.floor((scrollTop-60)/2)+'px, 0)');
}
});
}
This is what causes that behavior. You can also use scripts like Stellar , Skrollr and many more. It's called Parallax scrolling
you have to set z-index for divs to show over each other
.divClass{
z-index: x ;
}
note: x is a number.
if you have two divs with two different classes like these:
.divClass1{
z-index:100;
}
.divClass2{
z-index:101;
}
.divClass2 is shown over divClass1
Use z-index
#divid
{
z-index: 100;
}
#divid div
{
z-index: 101;
}

Resources