Jump to content

Search the Community

Showing results for tags 'tbitmap32'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 1 result

  1. The app I'm working on has different "screens", which are each essentially large bitmaps. When closing a screen to go to the next one, the following code provides a fade-to-black transition effect: procedure TGameBaseScreen.FadeOut; var Steps: Cardinal; i: Integer; P: PColor32; StartTickCount: Cardinal; IterationDiff: Integer; RGBDiff: Integer; const TOTAL_STEPS = 32; STEP_DELAY = 12; begin Steps := 0; StartTickCount := GetTickCount; while Steps < TOTAL_STEPS do begin IterationDiff := ((GetTickCount - StartTickCount) div STEP_DELAY) - Steps; if IterationDiff = 0 then Continue; RGBDiff := IterationDiff * 8; with ScreenImg.Bitmap do begin P := PixelPtr[0, 0]; for i := 0 to Width * Height - 1 do begin with TColor32Entry(P^) do begin if R > RGBDiff then Dec(R, RGBDiff) else R := 0; if G > RGBDiff then Dec(G, RGBDiff) else G := 0; if B > RGBDiff then Dec(B, RGBDiff) else B := 0; end; Inc(P); end; end; Inc(Steps, IterationDiff); ScreenImg.Bitmap.Changed; Changed; Update; end; end; Is there any way this same code can be modified to create a new FadeIn; procedure which allows the screen images to fade-in-from-black? I'm guessing I need to first specify that RGB := 0, 0, 0 and then increase the RGB values until they reach the actual bitmap values. Do I first need to "get" those values somehow? Or, is there a better way to achieve the Fade In/Out procedures? (note that we're dealing with combined bitmaps here, rather than single images)
×