AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Machine code functions: Bit Wizardry
Goto page Previous  1, 2, 3 ... 14, 15, 16, 17  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Laszlo



Joined: 14 Feb 2005
Posts: 4517
Location: Boulder, CO

PostPosted: Sat Jan 31, 2009 11:44 pm    Post subject: Reply with quote

How did you get your bitmap?
Back to top
View user's profile Send private message
Glasso
Guest





PostPosted: Sun Feb 01, 2009 12:14 am    Post subject: Reply with quote

Thank you for helping me figure this out, it is kind Very Happy

The bitmap was generated from Lexikos & TIC's functions, such as

Code:

pBitmap := Gdip_CreateBitmap(500,500, 0x26200A)


... it goes deeper into other related functions to pBitmap


G := Gdip_GraphicsFromImage(pBitmap)


;;; but what I want to do is turn the pBitmap into HEX BUFFER where it is appropriate and possible to do so Very Happy can you please show example how to? ... Very Happy
Back to top
Laszlo



Joined: 14 Feb 2005
Posts: 4517
Location: Boulder, CO

PostPosted: Sun Feb 01, 2009 2:54 am    Post subject: Reply with quote

Unfortunately, I am not an expert in that. You have to ask those guys. The returned bitmap can be a C++ class or a structure, where the size can be calculated from the fields in the beginning. You have to know the size, when you want to convert the bitmap to hex.
Back to top
View user's profile Send private message
Glasso
Guest





PostPosted: Sun Feb 01, 2009 4:30 am    Post subject: Reply with quote

Thank you for the insight there and idea. I will ask them to visit here, and maybe this can be expanded Wink
Back to top
Lexikos



Joined: 17 Oct 2006
Posts: 4473
Location: Qld, Australia

PostPosted: Sun Feb 01, 2009 8:24 am    Post subject: Reply with quote

How to retrieve bitmap data from a GDI+ bitmap: Advanced Graphic/Image question.
Back to top
View user's profile Send private message Visit poster's website
Glasso
Guest





PostPosted: Sun Feb 01, 2009 9:57 pm    Post subject: Reply with quote

Thank you Lexikos.

Might you know a faster way to turn a bitmap into some kind of usable text code? I thought this hex conversion under this thread would be fabulous, ... though the Lexikos function does sort of what I am asking, ... it takes a darn long time to fully scan in even a small image before it is turned into text. Neutral
Back to top
Lexikos



Joined: 17 Oct 2006
Posts: 4473
Location: Qld, Australia

PostPosted: Sun Feb 01, 2009 10:12 pm    Post subject: Reply with quote

Are you using ImageData_GetPixel? Pass the ImageData variable to Bin2Hex instead.
Back to top
View user's profile Send private message Visit poster's website
Glasso
Guest





PostPosted: Sun Feb 01, 2009 11:39 pm    Post subject: Reply with quote

Pretty cool Lexikos! I think I am almost there!, ... But how would I get the correct size of ImageData right for this function Very Happy

Code:

Bin2Hex(&ImageData,datasize)
Back to top
Lexikos



Joined: 17 Oct 2006
Posts: 4473
Location: Qld, Australia

PostPosted: Mon Feb 02, 2009 8:49 am    Post subject: Reply with quote

Code:
ImageData_GetSize(ImageData, Width, Height)
SizeInBytes := Width * Height * 4
Back to top
View user's profile Send private message Visit poster's website
Glasso
Guest





PostPosted: Tue Feb 03, 2009 3:20 am    Post subject: Reply with quote

Sweet Smile
Back to top
Glasso
Guest





PostPosted: Tue Feb 03, 2009 3:39 am    Post subject: Reply with quote

Lexikos - THANK YOU

i have just one more question. i get the flow of this now in terms of hex conversion, but question boggles my mind

1) what is IMAGEDATA, .. this is not a bitmap, or is it? not the same as PBITMAP or HBITMAP? Smile

2) i am used to working with P & H bitmaps. may i ask, so i can see the end to end conversion, ... if IMAGEDATA is neither a pbitmap or hbitmap, what would be the step to take IMAGEDATA and convert it to either one of those? Smile
Back to top
Lexikos



Joined: 17 Oct 2006
Posts: 4473
Location: Qld, Australia

PostPosted: Tue Feb 03, 2009 8:56 am    Post subject: Reply with quote

1) ImageData is a raw bitmap - i.e. an array of 32-bit pixel data.
2) I suggest you post in a GDI+ related thread, or start a new one.
GDI+ has very little to do with this thread.
Back to top
View user's profile Send private message Visit poster's website
Glasso
Guest





PostPosted: Sun Feb 08, 2009 6:55 am    Post subject: Reply with quote

Thank you so much Lexikos. Could you please do me a favor a look at this separated thread? Smile I've advanced it just a bit Smile

Kind regards, glasso

http://www.autohotkey.com/forum/post-248749.html
Back to top
Glasso2
Guest





PostPosted: Fri Feb 13, 2009 6:34 am    Post subject: Reply with quote

Laszlo,
I am having some problems with the MCODE function, ... basically I am having trouble clearing it out. If I pass a variable that happens to be smaller than the last one, ... it actually leaves a ghost of the tail of the last variable passed in. I suppose in the loop when it allocates the memory, it doesn't do anything to re-initialize itself, assuming something else was passed in before

Do you know how to fix this somehow Smile

pls see:
http://www.autohotkey.com/forum/topic40937.html
Back to top
Laszlo



Joined: 14 Feb 2005
Posts: 4517
Location: Boulder, CO

PostPosted: Fri Feb 13, 2009 6:39 am    Post subject: Reply with quote

Glasso2 wrote:
If I pass a variable that happens to be smaller than the last one, ... it actually leaves a ghost of the tail of the last variable passed in.

AHK Help wrote:
to explicitly shrink a variable, first free its memory with VarSetCapacity(Var, 0) and then use VarSetCapacity(Var, NewCapacity)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3 ... 14, 15, 16, 17  Next
Page 15 of 17

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group