AutoHotkey Community

It is currently May 26th, 2012, 2:52 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 356 posts ]  Go to page Previous  1 ... 12, 13, 14, 15, 16, 17, 18 ... 24  Next
Author Message
 Post subject:
PostPosted: January 31st, 2009, 11:44 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
How did you get your bitmap?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2009, 12:14 am 
Thank you for helping me figure this out, it is kind :D

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 :D can you please show example how to? ... :D


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2009, 2:54 am 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2009, 4:30 am 
Thank you for the insight there and idea. I will ask them to visit here, and maybe this can be expanded ;)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2009, 8:24 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
How to retrieve bitmap data from a GDI+ bitmap: Advanced Graphic/Image question.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2009, 9:57 pm 
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. :|


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2009, 10:12 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
Are you using ImageData_GetPixel? Pass the ImageData variable to Bin2Hex instead.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2009, 11:39 pm 
Pretty cool Lexikos! I think I am almost there!, ... But how would I get the correct size of ImageData right for this function :D

Code:
Bin2Hex(&ImageData,datasize)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 2nd, 2009, 8:49 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
Code:
ImageData_GetSize(ImageData, Width, Height)
SizeInBytes := Width * Height * 4


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 3rd, 2009, 3:20 am 
Sweet :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 3rd, 2009, 3:39 am 
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? :)

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? :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 3rd, 2009, 8:56 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 8th, 2009, 6:55 am 
Thank you so much Lexikos. Could you please do me a favor a look at this separated thread? :) I've advanced it just a bit :)

Kind regards, glasso

http://www.autohotkey.com/forum/post-248749.html


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 13th, 2009, 6:34 am 
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 :)

pls see:
http://www.autohotkey.com/forum/topic40937.html


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 13th, 2009, 6:39 am 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
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)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 356 posts ]  Go to page Previous  1 ... 12, 13, 14, 15, 16, 17, 18 ... 24  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: daonlyfreez and 16 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group