English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 30 October 2021, 21:05   #1
DisasterIncarna
Registered User
 
DisasterIncarna's Avatar
 
Join Date: Oct 2021
Location: England
Posts: 1,171
Blitz2/AmiBlitz - Color Remapped Image...

I made a workbench friendly program but would like a 64color image pasted into the window, no animation or anything just a plain static image, however when i use wblit or bitmaptowindow the image is indeed placed inside the workbench window but the color palette is not correct, if i use the bitmaps palette, then the colors work, the image is shown correctly but the workbench/intuition colors all get changed/messed up.

Is there a way to correct the bitmaps colors without corrupting workbench color palette? i saw in some recent notes on amiblitz that it supports guigfx.library, which when reading its description/notes, seems perfect for dealing with images when making WB friendly programs, does anyone know how to use guigfx.library within amiblitz to just load an image and paste it into the window with correct colors?

Also if that does work, i assume, the same thing could be used for workbench games? found it strange there wasnt a slew of WB games/ports that used something similar, just not done?, not worth it?, or people prefer to do games the traditional way?
DisasterIncarna is offline  
Old 30 October 2021, 22:10   #2
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
Remapping is a little tricky because you need to do things the OS way when you're dealing with graphics on the Workbench screen - it really is far simpler to use your own screen so you have full control over the palette. But, what you need to do is something along the lines of allocating pens for the colours that you require, then remapping your images after you load them to match the pens you obtained. You can't guarantee they'll be the same each time so you can't pre-map the images until you lock the pens.

The AmiBlitz3 includes have some functions for doing that, but (and this is the reason most games don't bother) going through the OS for your blitting, drawing and palette handling within a window on a public screen is a lot slower than doing it directly on your own bitmaps and your own screen.
Daedalus is offline  
Old 30 October 2021, 22:36   #3
DisasterIncarna
Registered User
 
DisasterIncarna's Avatar
 
Join Date: Oct 2021
Location: England
Posts: 1,171
for the tools and games i planned on making, slow blitting isnt really a problem, im more into slow/minor gfx strategy games like milenium2.2/deuteros (and numerous old wb/board/card games etc) and the likes where this wouldnt be a problem, also not a problem for some useful workbench tools/etc.

The pure lack of speed i have no issue with, its really just the "how do i do it" part thats got me atm as i get back into all things amiga (esp nwo i have os32 and found amiblitz was a thing).

Last edited by DisasterIncarna; 30 October 2021 at 23:02.
DisasterIncarna is offline  
Old 31 October 2021, 00:10   #4
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
Ah cool, in that case, check out image.include from AmiBlitz 3. It contains lots of routines for loading images in a variety of formats and blitting them to the screen using system-friendly methods. If you load the include itself into the editor and compile it directly, it launches a demo program and you can see it in action. Cmap.include might be useful too, it provides functions for remapping graphics based on an existing palette.
Daedalus is offline  
Old 31 October 2021, 01:27   #5
DisasterIncarna
Registered User
 
DisasterIncarna's Avatar
 
Join Date: Oct 2021
Location: England
Posts: 1,171
i think i tried that image routine and it just gave errors on compile so thats why i was looking at other things like the guigfx support, tho i have no idea how to use it properly.
DisasterIncarna is offline  
Old 03 November 2021, 13:24   #6
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
Hmmm, it should just work - at least it does here without making any changes. Maybe you need to set the executable directory so it can find the graphics files it uses? It looks for them in a relative path from where the executable would be.
Daedalus is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
[cross-platform] Gimp python plugin to bring image near OCS color resolution alkis Coders. General 20 19 September 2022 17:06
Image conversion from RGB to indexed color sparhawk Graphics 3 15 January 2020 21:53
Printing in color with WinUAE on color laser source support.Apps 7 14 April 2013 00:32
ISO true color to 256 color algorithm Lord Riton Coders. General 19 15 April 2011 17:49
Can amiblitz (blitz basic2) blit an image per bitplane? Michael Parent Coders. General 7 29 October 2009 17:59

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 20:07.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11348 seconds with 15 queries