if (xp < 0 ) xp = 0;
}
Fon rasm
Fon rasm dasturi forma yuzasiga bitli shaklni ko’p marta chiqarish yo’li bilan fon rasmni hosil qilishni namoish etgan. Bitli shakl fayldan yuklanadi, lekin resursdan ham yuklanishi mumkin. fon rasmni shakllantirish uchun foydalaniladigan bitli shakl va dastur oynasi 1.36-rasmda keltirilgan.
a) b)
1.36-rasm. Formadagi fon rasm (a) bitli shaklni (b) ko’pmarta chiqarish bilan shakllantirilgan
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
back = new Graphics::TBitmap();//ob’yektni yaratish -
// bitli shakl
// rasmni yuklash
try // rasmni yuklash jarayonida xato bo’lishi mumkin {
Form1->back->LoadFromFile("fon_rasm.bmp");
}
Do'stlaringiz bilan baham: |