Recent

Author Topic: Show graphic on screen  (Read 10198 times)

DesJardins

  • New Member
  • *
  • Posts: 27
Re: Show graphic on screen
« Reply #15 on: January 31, 2019, 02:19:35 am »
Thank you all for your comments.

Engkin's method works,  I substituted my image.gif and changed to FPreadGIF and window shows with image in upper left  corner.   but for some reason it does not use AposX and AposY.  When it compiles it gives  me a HINT that says they are not used.  I was expecting this to be the screen anchor location of the upper left corner of the image. 

I think I can change the size of the image to fit my program screen and save that as a file before I try to load it, but I would like it to center at the top of the page and maybe drop it down a few lines. 


I am not looking for a pop-up window.  I want to use it as the program start page.  If I can put the image at the top and put text below that startup page then fine, but if I cannot I would just make the image a full page to start and go to a second page for the text. before the working part of the program loads.

Richard



engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: Show graphic on screen
« Reply #16 on: January 31, 2019, 02:30:22 am »
for some reason it does not use AposX and AposY.  When it compiles it gives  me a HINT that says they are not used.  I was expecting this to be the screen anchor location of the upper left corner of the image. 

I forgot using them. Simply add their values to x and y:
Code: Pascal  [Select][+][-]
  1.           SetPixel(LDC, APosX+x, APosY+y, LWinColor.RGB);

Just be aware that the image is not retained.

440bx

  • Hero Member
  • *****
  • Posts: 6350
Re: Show graphic on screen
« Reply #17 on: January 31, 2019, 10:40:06 am »
I want to use it as the program start page.  If I can put the image at the top and put text below that startup page then fine, but if I cannot I would just make the image a full page to start and go to a second page for the text. before the working part of the program loads.

Richard
if you do it that way, you'll have to clear the console window before outputting text after you've drawn the image, otherwise the image will be "damaged" making it look unprofessional.  Also, if the user moves the console window or moves another window over it, that also has the potential of damaging the image and there is no way for your app to receive a notification that the image needs to be refreshed.

Succinctly, drawing directly on the console window, while obviously possible, has a lot of potential problems for which there are no simple solutions.

I suggest you use the popup window method with a window that has no caption and no border placed on top of the console window.  That way, the image won't be "corrupted" when the app displays text on the console window below it and getting rid of the image is a simple DestroyWindow call away.

IOW, you can _simulate_ drawing on the console window without all the problems that come from actually drawing on the console window.

HTH.

ETA: as Engkin mentioned, not only is the image not retained, there is no easy way to update it if need be.  The problem isn't drawing on the console window, the problem is ensuring the integrity of the image no matter what the user does to the console window.

« Last Edit: January 31, 2019, 10:42:38 am by 440bx »
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: Show graphic on screen
« Reply #18 on: January 31, 2019, 07:02:20 pm »
if memory serves, that image came with Borland Pascal 7

It was in a folder related to computer vision in my computer. Originally I had it from Prof. Ramanan's old page. The image is next to "Leveraging Archival Video for Building Face Datasets" paper. Will not be surprised if it came from Borland Pascal 7, as the paper is dated 2007.

lucamar

  • Hero Member
  • *****
  • Posts: 4217
Re: Show graphic on screen
« Reply #19 on: January 31, 2019, 08:48:29 pm »
if memory serves, that image came with Borland Pascal 7
Will not be surprised if it came from Borland Pascal 7, as the paper is dated 2007.

I would be very surprised: the last BP7 version (7.01) was released in 1993 and it came with no images other than the extrictly needed for the (Windows) demos, none of which this is. ;)

It may be from some Delphi above Delphi 7 ... but my guess would be that it either was created specifically for that report or taken from some collection in the web.

Or if you meant 440bx's image, that is from Delphi (first appeared in Delphi 3, IIRC)
« Last Edit: January 31, 2019, 08:50:51 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

440bx

  • Hero Member
  • *****
  • Posts: 6350
Re: Show graphic on screen
« Reply #20 on: January 31, 2019, 08:54:49 pm »
It was in a folder related to computer vision in my computer. Originally I had it from Prof. Ramanan's old page. The image is next to "Leveraging Archival Video for Building Face Datasets" paper. Will not be surprised if it came from Borland Pascal 7, as the paper is dated 2007.
You got me curious and decided to see if I could verify where I got it from.  Actually, mine is from Delphi 2.0, not BP7.  My copy is located in Delphi 2.0\IMAGES\SPLASH\16COLOR\CHIP.BMP

Good thing hard drives are getting bigger every day. ;)

ETA:

@lucamar:

You're right that it did not come (at least the copy I have) from BP7 (I cannot confirm it because BP7, unlike Delphi 2.0,  I no longer have it installed on my machine.  If it is not included in BP7 (and you may very well be right about that), I can confirm that it is included in Delphi 2.0.



« Last Edit: January 31, 2019, 09:27:00 pm by 440bx »
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

lucamar

  • Hero Member
  • *****
  • Posts: 4217
Re: Show graphic on screen
« Reply #21 on: January 31, 2019, 09:09:33 pm »
I can confirm: I checked both my installed BP7 and the original disks--ok, the disk images :) I was curious too so I also checked Delphi 1 and 3 (I don't have a Delphi 2) and found your image in Delphi 3. I guess they added them in Delphi 2 and never bothered to update/delete them.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

DesJardins

  • New Member
  • *
  • Posts: 27
Re: Show graphic on screen
« Reply #22 on: February 01, 2019, 08:38:21 am »
Thanks everyone,

The X,Y problem is solved.  but.......as you said, the image is not retained.  I have tried several ways, like "delay 5000" or I can stop it at LImage.height-2, or add a readln or readkey, use a "while"  but then it will not restart and go to the next screen.  Actually readln does not work at all.  So I guess I have to figure out how to do the pop-up window.  Too late tonight to start on that.  Any help along that line would be appreciated.

Richard

 

TinyPortal © 2005-2018