c# - Application cannot locate resource file in Visual Studio 2010 designer -
i made custom user control contains picturebox
, renders png image resource folder:
private void picturebox1_paint(object sender, painteventargs e) { //overlay shape of image transparentimg = image.fromfile("..\\..\\resources\\reservoir_img.png"); e.graphics.drawimage(transparentimg, new point(0, 0)); }
when build , run application user control paint method renders png fine (path must right), when preview form designer in visual studio 2010 doesn't render. shows exception:
i can develop , test application, it's kind of annoying design forms when see exception texts.
solution use resources.resx file:
e.graphics.drawimage(windowsformsapplication1.properties.resources.reservoir_img, new point(0, 0));
Comments
Post a Comment