C# Class ScreenToGif.Modern

Mostrar archivo Open project: dbremner/ScreenToGif

Public Methods

Method Description
InsertText ( String text ) : void

Insert text in the picture with specific font and color.

Modern ( ) : System

Default constructor of the form Modern.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

OnPaint ( PaintEventArgs e ) : void
ProcessCmdKey ( Message &msg, Keys keyData ) : bool

Process the Key events, such as pressing. This handles the keyboard shortcuts.

WndProc ( Message &m ) : void

Private Methods

Method Description
AddFrames ( string filename, Bitmap bitmap ) : void
AddPictures ( string fileName ) : void
ApplyActionToFrames ( string actionLabel, ActionEnum actionType, float pickerValue, object param = null ) : void

Apply desired option on selected frame(s)

The purpose of this function is that we can apply almost every action/option to the selected frame(s), so if you want to use it please be sure that the desired action is added to [_actionEnum] Enum.

AutoFitButtons ( ) : void

Changes the way that the Record and Stop buttons are shown.

Blur_Click ( object sender, EventArgs e ) : void

Apply selected image to a blur filter

CallBack ( IAsyncResult r ) : void
CallBackFilter ( IAsyncResult r ) : void
CallBackStop ( IAsyncResult r ) : void
Cancel ( ) : void

Cancels the editor phase, returning to the recording.

CreateTemp ( ) : void

Creates the temp folder that holds all frames.

DelayUpdate ( ) : void

Updates the label that shows the delay of the current frame

DoWork ( ) : void

Thread method that encodes the list of frames.

EditFrames ( ) : void

Constructor of the Frame Edit Page.

FinishState ( ) : void

Do all the work to set the controls to the finished state. (i.e. Finished encoding)

Grayscale_Click ( object sender, EventArgs e ) : void

Apply selected image to a grayscale filter

HideWindowAndShowTrayIcon ( ) : void
InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

KeyHookTarget ( object sender, KeyEventArgs e ) : void

KeyHook event method. This fires when the user press a key.

MainForm_FormClosing ( object sender, FormClosingEventArgs e ) : void

Before close, all settings must be saved and the timer must be disposed.

MainForm_MouseDown ( object sender, MouseEventArgs e ) : void
MainForm_MouseMove ( object sender, MouseEventArgs e ) : void
MainForm_Resize ( object sender, EventArgs e ) : void
Modern_TextChanged ( object sender, EventArgs e ) : void

When the Text property changes, set the text to the labelTitle.

ModifyCaptureTimer ( bool isEnabled ) : void
ModifyCaptureTimerAndChangeTrayIconVisibility ( bool isTimerAndTrayIconEnabled ) : void
MouseHookTarget ( object sender, MouseEventArgs keyEventArgs ) : void

MouseHook event method, not implemented.

Negative_Click ( object sender, EventArgs e ) : void

Convert selected image to negative filter

NotifyIconClicked ( object sender, EventArgs eventArgs ) : void
Pixelate_Click ( object sender, EventArgs e ) : void

Apply selected image to a pixelated filter

PlayPreview ( ) : void
RecordPause ( ) : void

Method that starts or pauses the recording

ResetUndoProp ( ) : void

Reset and Undo properties

ResizeFormToImage ( ) : void

Resizes the form to hold the image

Save ( ) : void

Prepares the recorded frames to be saved/edited

SelectFrame ( int index ) : void

Select frame by its System.Int32 index.

SepiaTone_Click ( object sender, EventArgs e ) : void

Convert selected image to SepiaTone filter

ShowHideButtons ( bool isEdit ) : void

Show or hide the panelBottom buttons.

ShowWindowAndHideTrayIcon ( ) : void
Stop ( ) : void

Stops the recording or stops the pre-start timer.

StopAsync ( ) : void
StopPreview ( bool shouldSincronize = true ) : void

Stops the preview

btnCancel_Click ( object sender, EventArgs e ) : void

Ignores all the alterations and hides this page.

btnClose_Click ( object sender, EventArgs e ) : void
btnConfig_Click ( object sender, EventArgs e ) : void
btnDeleteFrame_Click ( object sender, EventArgs e ) : void
btnDone_Click ( object sender, EventArgs e ) : void

Accepts all the alterations and hides this page.

btnFilters_Click ( object sender, EventArgs e ) : void

Opens the filter context menu.

btnFreeDrawing_Click ( object sender, EventArgs e ) : void
btnGifConfig_Click ( object sender, EventArgs e ) : void
btnHideListFrames_Click ( object sender, EventArgs e ) : void
btnInfo_Click ( object sender, EventArgs e ) : void
btnMaximize_Click ( object sender, EventArgs e ) : void
btnMinimize_Click ( object sender, EventArgs e ) : void
btnNext_Click ( object sender, EventArgs e ) : void
btnOptions_Click ( object sender, EventArgs e ) : void

Opens the options context menu.

btnPrevious_Click ( object sender, EventArgs e ) : void
btnRecordPause_Click ( object sender, EventArgs e ) : void
btnReset_Click ( object sender, EventArgs e ) : void
btnShowListFrames_Click ( object sender, EventArgs e ) : void
btnStop_Click ( object sender, EventArgs e ) : void
btnUndo_Click ( object sender, EventArgs e ) : void
con_Border_Click ( object sender, EventArgs e ) : void

Adds a border in all images. The border is painted in the image, the image don't increase in size.

con_CaptionOptions_Click ( object sender, EventArgs e ) : void
con_Color_Click ( object sender, EventArgs e ) : void

Convert selected image to a color filter

con_Fullscreen_CheckedChanged ( object sender, EventArgs e ) : void
con_MakeACopy_Click ( object sender, EventArgs e ) : void
con_MoveDownwards_Click ( object sender, EventArgs e ) : void
con_MoveUpwards_Click ( object sender, EventArgs e ) : void
con_Progress_Click ( object sender, EventArgs e ) : void
con_RenameFrame_Click ( object sender, EventArgs e ) : void
con_Snapshot_CheckedChanged ( object sender, EventArgs e ) : void
con_Transitions_Click ( object sender, EventArgs e ) : void
con_addCaption_Click ( object sender, EventArgs e ) : void
con_addText_Click ( object sender, EventArgs e ) : void
con_changeSpeed_Click ( object sender, EventArgs e ) : void
con_cropAll_Click ( object sender, EventArgs e ) : void
con_deleteAfter_Click ( object sender, EventArgs e ) : void
con_deleteBefore_Click ( object sender, EventArgs e ) : void
con_deleteSelectedFrame_Click ( object sender, EventArgs e ) : void
con_exportFrame_Click ( object sender, EventArgs e ) : void
con_flipRotate_Click ( object sender, EventArgs e ) : void
con_image_Click ( object sender, EventArgs e ) : void

Insert one image to desired position in the list.

con_resizeAllFrames_Click ( object sender, EventArgs e ) : void
con_revertOrder_Click ( object sender, EventArgs e ) : void

ListFramesInverted

con_showGrid_CheckedChanged ( object sender, EventArgs e ) : void
con_tbCaption_KeyDown ( object sender, KeyEventArgs e ) : void
con_tbDelay_KeyDown ( object sender, KeyEventArgs e ) : void

Called when the user hits the key "Enter" while focused in the con_tbDelay text box. It closes the context menu.

con_tbDelay_TextChanged ( object sender, EventArgs e ) : void

Called after the user changes the text of the toolstrip of the delay.

con_titleImage_Click ( object sender, EventArgs e ) : void
con_yoyo_Click ( object sender, EventArgs e ) : void

Make a Yoyo with the frames (listFrames + listFramesInverted)

contextMenuTreeview_Opening ( object sender, System e ) : void
contextMenu_Opening ( object sender, System e ) : void
contextRecord_Closing ( object sender, ToolStripDropDownClosingEventArgs e ) : void
contextRecord_Opening ( object sender, System e ) : void
lblDelay_MouseDown ( object sender, System e ) : void

Updates the _clicked flag or opens the contextMenu.

lblDelay_MouseMove ( object sender, System e ) : void

Gets if the user is draging to up or down and updates the values.

lblDelay_MouseUp ( object sender, System e ) : void

Updates the flag _clicked to false and sets the delay value to the list.

pictureBitmap_DragDrop ( object sender, System e ) : void
pictureBitmap_DragEnter ( object sender, System e ) : void
pictureBitmap_MouseClick ( object sender, System e ) : void
processing_Disposed ( object sender, EventArgs e ) : void

Resets the state of the program, after closing the "Finished" page.

tbSize_KeyDown ( object sender, KeyEventArgs e ) : void

User press Enter, updates the form size.

tbSize_KeyPress ( object sender, KeyPressEventArgs e ) : void

Prevents keys!=numbers

tbSize_Leave ( object sender, EventArgs e ) : void

After leaving the textBox, updates the size of the form with what is typed

timerCapWithCursorFull_Tick ( object sender, EventArgs e ) : void

Takes a screenshot of th entire area and add to the list, plus add to the list the position and icon of the cursor.

timerCapWithCursor_Tick ( object sender, EventArgs e ) : void

Takes a screenshot of desired area and add to the list, plus add to the list the position and icon of the cursor.

timerCaptureFull_Tick ( object sender, EventArgs e ) : void

Takes a screenshot of the entire area and add to the list.

timerCapture_Tick ( object sender, EventArgs e ) : void

Takes a screenshot of desired area and add to the list.

timerPlayPreview_Tick ( object sender, EventArgs e ) : void
timerPreStart_Tick ( object sender, EventArgs e ) : void

Timer used after clicking in Record, to give the user a shor time to prepare recording

trackBar_Scroll ( object sender, EventArgs e ) : void

When the user slides the trackBar, the image updates.

trackBar_ValueChanged ( object sender, EventArgs e ) : void

When the user slides the trackBar, the image updates.

tvFrames_AfterCheck ( object sender, TreeViewEventArgs e ) : void
tvFrames_AfterSelect ( object sender, TreeViewEventArgs e ) : void
tvFrames_NodeMouseClick ( object sender, TreeNodeMouseClickEventArgs e ) : void

Method Details

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
return void

InsertText() public method

Insert text in the picture with specific font and color.
public InsertText ( String text ) : void
text String Content to insert
return void

Modern() public method

Default constructor of the form Modern.
public Modern ( ) : System
return System

OnPaint() protected method

protected OnPaint ( PaintEventArgs e ) : void
e PaintEventArgs
return void

ProcessCmdKey() protected method

Process the Key events, such as pressing. This handles the keyboard shortcuts.
protected ProcessCmdKey ( Message &msg, Keys keyData ) : bool
msg Message A Message, passed by reference, that represents the window message to process.
keyData Keys One of the Keys values that represents the key to process.
return bool

WndProc() protected method

protected WndProc ( Message &m ) : void
m Message
return void