作者xsoho ( )
看板C_and_CPP
标题[问题] 显示图片
时间Tue Mar 3 11:26:42 2009
private: System::Void panel1_Paint(System::Object^ sender,
System::Windows::Forms::PaintEventArgs^ e)
{
if(streamImage1 != nullptr)
{
Graphics^ g = e->Graphics;
Bitmap ^ bmpPicture = safe_cast<Bitmap ^>(Image::FromStream(streamImage1));
this->panel1->AutoScrollMinSize =
System::Drawing::Size(bmpPicture->Width,bmpPicture->Height);
g->TranslateTransform((float)AutoScrollPosition.X,
(float)AutoScrollPosition.Y);
Rectangle rect = Rectangle(AutoScrollPosition.X,AutoScrollPosition.Y,
bmpPicture->Width,bmpPicture->Height);
g->DrawImage(bmpPicture,rect);
}
}
我想要可以用卷轴看图片,但虽然有卷轴跑出来,不过显示的影像还是不变
都只有残影现象,不知道为什麽会这样。
我试过类似的方法在pictureBox上是可以的,但上面程式码的方法就不行
想请问问题出在哪? 谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.124.69.118
※ 编辑: xsoho 来自: 59.124.69.118 (03/03 11:33)
1F:→ xsoho:耍笨了 少加了 "this->panel1->"AutoScrollPosition 03/03 12:01