问题描述
嗨.我正在处理我的应用程序(双线性图像变形器)必须全屏运行的情况.我正在使用c ++图形来渲染图片框内的位图(例如,使图形^ g = picturebox1-> CreateGraphics();只是为了清楚起见).我要实现的是使Picturebox完全没有Windows托盘或其他任何东西,而只是picturebox.希望有一种方法我知道这个渲染器不是一个好主意,但是由于截止日期的问题,没有时间研究一些适当的DirectDraw或OpenGL方法.
计划B将创建一个新的窗体,不添加边框样式,最大程度地包含一个与窗体相同的宽度和高度的图片框,但这样仍可以看到Windows托盘,这对我来说不是很好.但是,这是紧急解决方案的情况"
Hi. I am dealing with a situation where my application (bi-linear image warper) have to run fullscreen. I am using c++ graphics to render bitmaps inside a picturebox(e.g. Graphics ^g=picturebox1->CreateGraphics(); just to make it clear ). What i want to achieve is make that picturebox fullsreen no windows tray or any other stuff just picturebox. Hope there is a way i know that this renderer is bad idea but because of deadline issues a dont have time to study some proper directdraw or opengl method.
Plan B would be to create a new form ,border style none ,maximized containing one picturebox with same width and height as the form but that way windows tray is still visible and that is not very good for me. However it a "case of emergency solution"
推荐答案
Form^ form = gcnew Form();
form->WindowState=System::Windows::Forms::FormWindowState::Maximized;
form->FormBorderStyle=System::Windows::Forms::FormBorderStyle::None;
System::Windows::Forms::PictureBox ^picb=gcnew PictureBox();
picb->Width=form->Width;
picb->Height=form->Height;
picb->Location=Point(0,0);
picb->BorderStyle=BorderStyle::None;
picb->BackgroundImage=bitmap2;
form->Controls->Add(picb);
form->Show();
而且看起来可以解决问题.但是这样做仍然有些混乱……
and it looks that it will do the trick. But still its a bit messy way to do that ...
这篇关于全屏图片框图形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!