Hack Forums
[.NET] Monogame render embbeded into PictureBox - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] Monogame render embbeded into PictureBox (/showthread.php?tid=5655235)



Monogame render embbeded into PictureBox - Zilog80 - Jun 25, 2017

[Image: CXHWGzd.png]

More images on spoiler:

Spoiler (Click to View)

How it works?

This tutorial has a triple combo:
  • Monogame stuff instead GDI/GDI+
  • Monogame stuff rendered on standard Winforms PictureBox control
  • Monogame stuff coded in VB.NET instead C#

Need Monogame installed on my rig to compile the source-code?

Technically no. Monogame is attached to solution as NuGet Package. And Content pipeline are "precompiled" to Content\bin\Windows\ folder

How the precompiled content is moved to debug\release output folder?

There is a PostBuild event on solution with this code:

Code
echo "Deleting previus Content Folder..."
rd "$(TargetDir)Content"
echo "Creating Content Folder..."
md "$(TargetDir)Content"
echo "Copying Content Files..."
xcopy "$(ProjectDir)Content\bin\Windows\*.*" "$(TargetDir)\Content" /Y /I /E

That postbuild event copy the precompiled content to your debug\Content or release\Content folder

That's nice. Give me the source-code!

Yes, sir:
Source: https://github.com/kernelENREK/MonogameWinformsDemo

Enjoy :)

Edited: highly recommended running the source code with headphones...


* - Barret - Jun 28, 2017

That looks nice zilogy, fine job you done there!!!!