[問題] 顯示圖片
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)
→
03/03 12:01, , 1F
03/03 12:01, 1F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章