[Tex/LaTex] How to insert images with graphicx

graphics

I'm trying to insert an image to my file, but I can't figure out how to do it. I've added

\usepackage{graphicx}

to my preamble and when I drag and drop an image to my file (I'm working with TeXStudio), the following code appears:

\begin{figure}
\centering
\includegraphics[width=0.7\linewidth]{"My Pretty Image"}
\end{figure}

However, this doesn't want to work.

What did I do wrong and how can I solve this?

Best Answer

A complete answer for just reference.
\bigskip % Add an empty line
%These are optional parameters to finetune the placement of tables and figures, with the following meaning:
%
%h, here
%t, top
%b, bottom
%p, page of float
%e.g. \begin{figure}[!htb]
\begin{figure}[ht!]
\centering
\includegraphics[width=90mm]{imagename.png}
\caption{This is the caption}
\label{overflow}
\end{figure}
Related Question