Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 925965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:36:21+00:00 2026-05-15T19:36:21+00:00

I have an application that prints text and images to pages on a printer.

  • 0

I have an application that prints text and images to pages on a printer. At the footer, we output an image, which is cached by loading it once, and stored in a TBitmap. In the print routine, it creates a new TBitmap, then calls a function which assigns the cached bitmap. It then ends up calling Canvas.StretchDraw on that bitmap.

Function GetFooterGraphic(Var xBitmap : TBitmap) : boolean;
begin
  // load cache here
  if assigned(g_xFooterBitmap) then
  begin
    xBitmap.Assign(g_xFooterBitmap);
    result := true;
  end;
end

// Get bitmap, then:
xCanvas.StretchDraw(xDrawRect, xBitmap);

The problem is that the bitmap is failing to work after a certain number of pages. I can only imagine that this is a driver problem, but it happens on most printers at different times. I can fix it by reloading the bitmap each time, but I’d rather keep the cache.

Having looked at the VCL, the xBitmap.Assign actually just adds a reference to the stored item. What I want to do is take a complete copy, the most efficient way. Which comes to the question:
How can I make the TBitmap content completely independent of any other reference?

I’d like to keep the cached TBitmap content completely independent, and return a complete (deep) copy, so that the printing does not affect the cached version, and thus hopefully fix this issue.

Delphi 2007 if relevant.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T19:36:22+00:00Added an answer on May 15, 2026 at 7:36 pm

    I cannot test it here because I’m not able to reproduce the problem, but perhaps a call to FreeImage right after the Assign may help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that prints by generating text files with embedded printer codes,
I have one application that prints messages from Test.exe in console .My java program
I have a Windows console application that returns some text. I want to read
I have a mature MFC C++ application that displays on screen and prints using
There is application that handles text commands. I have a Qt widget that is
I have an application that uses disabled JTextFields in several places which are intended
I have an RCP application that uses extension points to defined various pluggable bits
I have application that makes different queries with different results so the caching in
I have application that is connecting to the DB and if I enter incorrect
I have application that is up more than 3 days. I can see in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.