user29A / JPFITS

FITS File interaction written in Visual Studio C# .Net. JPFITS is not based on any other implementations and is written from the ground-up, consistent with the FITS standard, designed to interact with fits files as object-oriented structures. See the github Wiki link below for more info.
https://github.com/user29A/JPFITS/wiki
17 stars 1 forks source link

How to Display a JPBitMap.ArrayToBmp #5

Closed SteveRowl closed 2 years ago

SteveRowl commented 2 years ago

Hi Joe

Thanks for your continued help.

A friend and I are working to rewrite a popular but old Win astronomy app (VB6) into VB.net. More history to follow.

Dim fitsimgstr As String = "E:\AIP General\wetransfer_small-test-images_2021-09-12_0626\TestImages_Classic\Lena.fts" ';//the full file name Dim DImCLim() As Double = {0.05, 0.95} 'The image contrast limits. A 2-element array which clips the low (element 1) and high (element 2) values when forming the bitmap. Dim fitsimgArray(,) As Double

PictureBox1.Image = JPBitMap.ArrayToBmp(fitsimgArray, 0, 0, False, DImCLim, 256, 256, False)

where PictureBox1 is a Microsoft PictureBox on a Form.

Image attached.

I get a blank PictureBox.

My question is: Are these reasonable values for: DImCLim() As Double = {0.05, 0.95}?

Regards

Steve Lena.zip

user29A commented 2 years ago

Hi Steve,

If you are looking for a good Windows astronomy and FITS display/processor app, I highly suggest to take a look at CCDLAB:

https://github.com/user29A/CCDLAB/releases/download/2021.12.09/CCDLAB.Setup.msi

The image contrast limits are with respect to the FITS image values themselves. A typical good setting is

DImCLim[0] = fitsimg.mean - 0.5 fitsimg.stdv; DImCLim[1] = fitsimg.mean + 5 fitsimg.stdv;

The function JPBitMap.ArrayToBmp returns a bitmap.

I don't think that PictureBox1.Image = JPBitMap.ArrayToBmp(...) will work. What I do in CCDLAB is:

BITMAPIMG = JPBitMap.ArrayToBmp(...);//first set the BITMAPIMG which is a global variable

Then call PictureBox1.Refresh();

Then in the PictureBox1 Paint method you must have coded:

e.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor; e.Graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half; e.Graphics.DrawImage(BITMAPIMG , new Rectangle(0, 0, PictureBox1.Size.Width, PictureBox1.Size.Height));

But again, I highly recommend instead of re-building a Windows app, to now use CCDLAB which already does everything which would ever be needed:

https://github.com/user29A/CCDLAB/wiki

Please take a look at it, and let me know if it satisfies what you need a FITS view/processor to do. I would be happy to work with you on developing a good Windows app for astronomy, etc. CCDLAB already does a lot of things, etc.

Cheers,

Joe

user29A commented 2 years ago

Hi again Steve,

You can see a few videos on the CCDLAB YouTube channel:

CCDLAB

The videos up are mostly for its use with UVIT data reduction, but the videos demonstrate the basic display and interface, etc.

If you would like to work together to develop features in CCDLAB which you like from other apps, please let me know. CCDLAB is already highly developed so that gets thing much further ahead.

Cheers,

Joe

SteveRowl commented 2 years ago

Hi Joe

Thanks. I have installed CCDLAB and referred it to my colleague.

I will get back to you in a week or so when he has reviewed CCDLAB.

Regards

Steve

user29A commented 2 years ago

Hi Steve,

If either you or your colleague have questions about CCDLAB, please feel free to email me at:

joepostma@live.ca

I would be happy to discuss with you.

Regards,

Joe

SteveRowl commented 2 years ago

Hi Joe

Many thanks

Regards

Steve

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: user29A @.> Sent: Wednesday, December 29, 2021 4:57:52 AM To: user29A/JPFITS @.> Cc: SteveRowl @.>; Author @.> Subject: Re: [user29A/JPFITS] How to Display a JPBitMap.ArrayToBmp (Issue #5)

Hi Steve,

If either you or your colleague have questions about CCDLAB, please feel free to email me at:

@.**@.>

I would be happy to discuss with you.

Regards,

Joe

— Reply to this email directly, view it on GitHubhttps://github.com/user29A/JPFITS/issues/5#issuecomment-1002219732, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AXAW5SLQLF3KBGYMFVGIPP3UTH3CBANCNFSM5KYW2QWA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you authored the thread.Message ID: @.***>