You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
Announcement
Collapse
No announcement yet.
Recognize Loading BMP 16color/256color/24 bit etc.
Recognize Loading BMP 16color/256color/24 bit etc.
I use the loadimagex control to load bitmaps, the bitmap is shown on the screen but the quality of the image is not the same if it is a 16 color, 256 color, 24 bit, etc. Nevertheless if I load all them using for instance MSPaint the quality is fine in all cases. What could be the reason I have a distorted image in some cases?
Regards.
You will find that BitmapInfoHeader contains most of the information about a bitmap (BitmapInfo includes this plus the colour table). You could therefore look at biBitCount to see the bits per pixel (values= 1,4,8,24) and arrange your program to suit this value. I recommend 'Graphics File Formats' by Kay & Levine, published by McGraw (ISBN 0-07-034025-0) to anybody working with graphics files.
You can protect your bitmaps from use outside your program by 'corrupting' the header - change the first two bytes of the file to anything, change the extension to another graphics format (I use IMG) and write to CD. No graphics software will be able to load your image. When you want to use it, copy the file the hard drive, change the first two bytes back to BM, then load this uncorrupted image into your program - don't forget to delete the uncorrupted file from the drive when have finished with it. You cannot protect against screen grabs!
Iain Johnstone
------------------
“None but those who have experienced them can conceive of the enticements of science” - Mary Shelley
Thank you guys! But I would insist a little bit.
In fact I can read the bitmapinfoheader and I now using GetDeviceCaps how is my video, nevertheless I cannot link both information in the control add imagex, it doesn't have configuration parameters.
regards
Agustin
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment